Optimize the python code using premature optimization techniques.
def foo():
    a = []
    for i in range(1000):
        a.append(i)
# optimizing python code using premature optimization techniques
def foo():
    a = [i for i in range(1000)]