[Python-Dev] Fast access to __builtins__

Oren Tirosh oren-py-d@hishome.net
Fri, 28 Mar 2003 04:44:42 -0500


On Thu, Mar 27, 2003 at 09:51:13PM -0800, Neil Schemenauer wrote:
> Guido van Rossum wrote:
> > Though you probably would only want to warn when this is done to a .py
> > module -- C extensions should be exempt.
> 
> Exempt from poking or being poked?
> 
> > And the warning should only warn about inserting names that are
> > actually builtins.
> 
> I have rough patch.  The idea is to have the tp_setattro slot of modules
> check if the name being set is a builtin.  

Does it check if it's one of the standard __builtin__ module or whether 
it is an attribute of whatever object is currently set as the module's 
__builtins__ attribute?

    Oren