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/2006-March/062331.html below:

[Python-Dev] Making builtins more efficient

[Python-Dev] Making builtins more efficient [Python-Dev] Making builtins more efficientJim Jewett jimjjewett at gmail.com
Mon Mar 13 20:47:19 CET 2006
Paul Moore wrote:

> Is there any practical way of detecting and flagging
> constructs like the above (remotely shadowing a
> builtin in another module)?

Phillip J. Eby wrote:
> the patch ended up being backed out ... too strict
> of a check to be accepted for Python 2.4.

http://svn.python.org/view/python/trunk/Objects/moduleobject.c

It was revision 33054, backed out in 33084.

The patch warned about any shadowing of builtins, which
probably is too strict.  An alternative might be to warn
only about modifying *another* module's globals.  (And
perhaps not just when they shadow builtins?)

For example, modules could grow a __sealed__ attribute
which gets set at the end of the import; instead of using
PyObject_GenericSetAttr directly, the tp_setattro slot
would check the __sealed__ attribute (and maybe squawk)
before deferring.

-jJ
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