[Python-Dev] Scope object (Re: nonlocals() function?)
Michael Foord
fuzzyman at voidspace.org.uk
Tue Apr 6 01:29:06 CEST 2010
On 06/04/2010 00:37, Greg Ewing wrote:
> Antoine Pitrou wrote:
>> Steve Bonner <pythonsteve <at> gmail.com> writes:
>>
>>> What do we think of adding a built-in nonlocals() function that would
>>> be similar to globals() and locals()?
>>
>> These scopes don't have parallel capabilities:
>
> Maybe it would be better to deprecate globals() and locals()
> and replace them with another function called something like
> scope(). It would return a mapping object that looks up
> names in the current scope. It could also improve on locals()
> by being writable.
>
Well, not a bad idea but it belongs on python-ideas and would be covered
by the language moratorium. :-)
Michael
--
http://www.ironpythoninaction.com/
http://www.voidspace.org.uk/blog
READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (”BOGUS AGREEMENTS”) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer.
More information about the Python-Dev
mailing list