[Python-3000] Change to class construction? (original) (raw)
Collin Winter collinw at gmail.com
Fri Jul 6 16:03:56 CEST 2007
- Previous message: [Python-3000] the do-while pep
- Next message: [Python-3000] Change to class construction?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
While experimenting with porting setuptools to py3k (as of r56155), I ran into this situation:
class C: a = (4, 5) b = [c for c in range(2) if a]
results in a "NameError: global name 'a' is not defined" error, while
class C: a = (4, 5) b = [c for c in a]
works fine. This gives the same error as above:
class C: a = (4, 5) b = [a for c in range(2)]
Both now-erroneous snippets work in 2.5.1. Was this change intentional?
Collin Winter
- Previous message: [Python-3000] the do-while pep
- Next message: [Python-3000] Change to class construction?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]