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