A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2003-October/039203.html below:

[Python-Dev] locals() (was Re: accumulator display syntax)

[Python-Dev] locals() (was Re: accumulator display syntax) [Python-Dev] locals() (was Re: accumulator display syntax)Phillip J. Eby pje at telecommunity.com
Tue Oct 21 17:57:39 EDT 2003
At 02:04 PM 10/21/03 -0700, Guido van Rossum wrote:

>Argh, someone *could* pass around a copy of locals() and make an
>assignment into that.

Not when the locals() is that of a CPython function, and I expect the same 
is true of Jython functions.


>   But I think we're already deprecating
>non-read-only use of locals(), so I'd like to ban that as abuse.

FWIW, both Zope 3 and PEAK currently make use of 'locals()' (actually, 
sys._getframe()) to modify locals of a class or module scope (i.e. 
non-functions).  For both class and module scopes, it seems to be implied 
by the language definition that the local namespace is the __dict__ of the 
corresponding object.

So, is this deprecated usage for class and module objects too?


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4