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/2004-April/044401.html below:

Treating Builtins as Constants in the Standard Library

[Python-Dev] PEP 329: Treating Builtins as Constants in the Standard Library [Python-Dev] PEP 329: Treating Builtins as Constants in the Standard LibraryPhillip J. Eby pje at telecommunity.com
Mon Apr 19 09:30:55 EDT 2004
At 08:54 AM 4/19/04 -0400, Raymond Hettinger wrote:
>Comments are invited on a new pep:
>
>         http://www.python.org/peps/pep-0329.html

I'm not sure I understand the reasoning for implementing this via a 
bytecode hack, rather than in the compiler or loading mechanisms.  I think 
I'd rather see something like:

    from __future__ import fast_globals

which would mean that globals and builtins could be considered constants 
unless declared with 'global' at the module level.  Then, the compiler 
could optimize any undeclared builtins, and the 'MAKE_FUNCTION' opcode 
could bind any constants defined as of the function's declaration.

Finally, the module object thus created would ban any __setattr__ on any 
constant that has been bound into a function.  (Since these are the only 
setattrs that could cause harm.)


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