[docs] [issue11796] Comprehensions in a class definition mostly cannot access class variable

Menno Smits report at bugs.python.org
Sat Apr 9 11:04:50 CEST 2011


Menno Smits <menno at freshfoo.com> added the comment:

Thanks to everyone for the explanations.

I was hoping for behaviour along the lines of Python 2 (certainly not artificially blocking more cases in the name of consistency) but it doesn't look like that's going to happen. I think this is one slight and rare area where Python 3 has taken a step backwards when compared to Python 2 but I can live with it. As noted there's other ways to achieve the same thing.

The new Python 3 behaviour seems odd to me but perhaps that's just a bias due to many years of development with Python 2. A documentation improvement would help. 

Thanks.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11796>
_______________________________________


More information about the docs mailing list