[issue12370] Use of super overwrites use of __class__ in class namespace
Nick Coghlan
report at bugs.python.org
Sun May 27 10:22:31 CEST 2012
Nick Coghlan <ncoghlan at gmail.com> added the comment:
As the checkin message says, this is once again a problem on trunk. The relevant test is still in place in test_super.py, I just marked it as an expected failure.
unittest.mock is currently avoiding the problem via the "_safe_super = super" workaround.
So, we need a new patch which fixes the misbehaviour *without* breaking the new tests I just added. I'm thinking something which special cases __class__ references in a ClassBlock to be dual purpose (i.e. both locals *and* closure variables) may be necessary, rather than the current approach of always coercing them to be closure variables.
----------
resolution: fixed ->
stage: committed/rejected -> needs patch
status: closed -> open
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12370>
_______________________________________
More information about the Python-bugs-list
mailing list