public
Created

  • Download Gist
gistfile1.py
Python
1 2 3 4 5 6 7 8 9 10 11 12 13
>>> class A(object):
... i = 3
... a = [i for x in range(3)]
...
>>> class A(object):
... i = 3
... a = list(i for x in range(3))
...
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 3, in A
File "<stdin>", line 3, in <genexpr>
NameError: global name 'i' is not defined

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.