[issue17853] Conflict between lexical scoping and name injection in __prepare__

2013-04-30 Thread Nick Coghlan
Nick Coghlan added the comment: Aside from the spurious definition of CLASS_FREE, looks good to me. I did need to double check that PyDict_GetItem is the API that *doesn't* raise the error :) -- ___ Python tracker rep...@bugs.python.org

[issue17853] Conflict between lexical scoping and name injection in __prepare__

2013-04-30 Thread Roundup Robot
Roundup Robot added the comment: New changeset cf65c7a75f55 by Benjamin Peterson in branch 'default': check local class namespace before reaching for cells (closes #17853) http://hg.python.org/cpython/rev/cf65c7a75f55 -- nosy: +python-dev resolution: - fixed stage: -

[issue17853] Conflict between lexical scoping and name injection in __prepare__

2013-04-28 Thread Alex Gaynor
Changes by Alex Gaynor alex.gay...@gmail.com: -- nosy: +alex ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17853 ___ ___ Python-bugs-list mailing

[issue17853] Conflict between lexical scoping and name injection in __prepare__

2013-04-28 Thread Benjamin Peterson
Changes by Benjamin Peterson benja...@python.org: -- versions: +Python 3.4 -Python 3.2, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17853 ___

[issue17853] Conflict between lexical scoping and name injection in __prepare__

2013-04-28 Thread Benjamin Peterson
Benjamin Peterson added the comment: Nick, care to review? -- keywords: +patch Added file: http://bugs.python.org/file30043/classderef.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17853

[issue17853] Conflict between lexical scoping and name injection in __prepare__

2013-04-28 Thread Ethan Furman
Ethan Furman added the comment: Thanks, Benjamin. Looking at that patch I realize the fix was way beyond my current core-hacking skills. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17853

[issue17853] Conflict between lexical scoping and name injection in __prepare__

2013-04-28 Thread Mark Dickinson
Mark Dickinson added the comment: What's the purpose of the CLASS_FREE #definition? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17853 ___ ___

[issue17853] Conflict between lexical scoping and name injection in __prepare__

2013-04-28 Thread Barry A. Warsaw
Changes by Barry A. Warsaw ba...@python.org: -- nosy: +barry ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17853 ___ ___ Python-bugs-list mailing

[issue17853] Conflict between lexical scoping and name injection in __prepare__

2013-04-28 Thread Benjamin Peterson
Benjamin Peterson added the comment: That's superflous. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17853 ___ ___ Python-bugs-list mailing

[issue17853] Conflict between lexical scoping and name injection in __prepare__

2013-04-27 Thread Nick Coghlan
Nick Coghlan added the comment: Just to clarify, the problem here isn't to do with referencing the class name in particular, it's referencing *any* lexically scoped name from the class body, when a metaclass wants to inject that as variable name in the class namespace. Here's a case where it

[issue17853] Conflict between lexical scoping and name injection in __prepare__

2013-04-27 Thread Benjamin Peterson
Changes by Benjamin Peterson benja...@python.org: -- nosy: +benjamin.peterson versions: +Python 3.2, Python 3.3 -Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17853 ___

[issue17853] Conflict between lexical scoping and name injection in __prepare__

2013-04-27 Thread Ethan Furman
Ethan Furman added the comment: Perhaps you and Benjamin should discuss that. :) I just read a thread on core-mentors about when a bug is fixed or not -- considering that the behavior is plain wrong, that workarounds will still work even if the bug is fixed, why shouldn't we fix it even in

[issue17853] Conflict between lexical scoping and name injection in __prepare__

2013-04-27 Thread Benjamin Peterson
Benjamin Peterson added the comment: There's no need for a discussion; the answer is no. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17853 ___

[issue17853] Conflict between lexical scoping and name injection in __prepare__

2013-04-27 Thread Nick Coghlan
Nick Coghlan added the comment: In this case, we won't fix it in a maintenance release because of the kind of change required to eliminate the bug. Adding a new opcode is likely to be the simplest fix and that is necessarily a backwards incompatible change (since older versions won't

[issue17853] Conflict between lexical scoping and name injection in __prepare__

2013-04-27 Thread Ethan Furman
Ethan Furman added the comment: Nick, thanks for the explanation. Benjamin, I was referring to Nick taking 3.3 and 3.2 off the issue and leaving 3.4, and you reversing it. ;) Sorry for the confusion -- I just reread my post and the words there didn't match the ideas in my head at the time