[Python-3000] Change to class construction?

Nick Coghlan ncoghlan at gmail.com
Tue Jul 10 11:33:04 CEST 2007


Phillip J. Eby wrote:
> At 06:13 PM 7/9/2007 +0300, Guido van Rossum wrote:
>> On 7/9/07, Phillip J. Eby <pje at telecommunity.com> wrote:
>> > At 09:03 PM 7/9/2007 +1000, Nick Coghlan wrote:
>> > >However, I will point out that setting class attributes via 
>> locals() is
>> > >formally undefined (it happens to work in current versions of CPython,
>> > >but there's no guarantee that will always be the case).
>> >
>> > As of PEP 3115, it's no longer undefined for class statements.
>>
>> Where does it say so? To be honest, I don't know where ti find Nick's
>> claim in the reference manual.
> 
> I assume Nick is referring to:
> 
>   http://www.python.org/doc/2.2/ref/execframes.html
> 
> which says it's undefined.

I was actually referring to this warning in the library reference docs 
for the locals() function:

   """Warning: The contents of this dictionary should not be modified; 
changes may not affect the values of local variables used by the 
interpreter."""

Cheers,
Nick.


-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
---------------------------------------------------------------
             http://www.boredomandlaziness.org


More information about the Python-3000 mailing list