from typing import List


def list_squares(n: int) -> List[int]:
    """Generates a list of squares of numbers from 0 to n using list comprehension.

    doctests:
    >>> list_squares(2)
    [0, 1, 4]
    >>> list_squares(5)
    [0, 1, 4, 9, 16, 25]
    """

    x = [i ** 2 for i in range(0, n + 1)]

    return x