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/039456.html below:

[Python-Dev] let's not stretch a keyword's use unreasonably, _please_...

[Python-Dev] let's not stretch a keyword's use unreasonably, _please_...Oren Tirosh oren-py-d at hishome.net
Fri Oct 24 14:26:29 EDT 2003
On Wed, Oct 22, 2003 at 09:11:37AM -0700, Alex Martelli wrote:
...
> Alternatively, assigning to an attribute of some particular
> object still feels a better approach to me -- no new kwd,
> no stretching of bad old ones, actually a chance to let bad
> old 'global' fade slowly into the sunset.  If there's any
> chance to salvage THAT approach -- if it only needs a good
> neat syntax to get that "particular object" -- I'll be glad
> to participate in brainstorming to find it.  

How about using the word 'global' to get the current module object?
A precedent for this is None which is on its way to becoming a keyword 
to get that "particular object". 

A bit of parser magic would be required so global can still work
as a declaration for compatibility.

>>> global is sys.modules[__name__]
True
>>> global.__dict__ is globals()
True

    Oren

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