On Fri, 03 May 2013 12:43:41 +1000 Steven D'Aprano <st...@pearwood.info> wrote: > On 03/05/13 11:29, Nick Coghlan wrote: > > An exchange in one of the enum threads prompted me to write down > > something I've occasionally thought about regarding locals(): it is > > currently severely underspecified, and I'd like to make the current > > CPython behaviour part of the language/library specification. (We > > recently found a bug in the interaction between the __prepare__ method > > and lexical closures that was indirectly related to this > > underspecification) > > Fixing the underspecification is good. Enshrining a limitation as the > one correct way, not so good.
I have to say, I agree with Steven here. Mutating locals() is currently an implementation detail, and it should IMHO stay that way. Only reading a non-mutated locals() should be well-defined. Regards Antoine. _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com