[IronPython] __builtins__

Sanghyeon Seo sanxiyn at gmail.com
Sun Jan 28 07:00:35 CET 2007


2007/1/28, J. Merrill <jvm_cop at spamcop.net>:
> Is it a typo that it says "...builtin__'> is not enumerable" (vs builtins)?

No. __builtin__ is a module. __builtins__ is a special variable that
may point to either a module or a module's dictionary.

> Would a solution be to implement the enumerable mechanism (over the names of the attributes) for __builtins__ ?  That would not be hard to do (I don't think) and would be unlikely to cause much trouble.

The Right Thing would be make CPython's __builtins__ consistent, or
remove it altogether. Either ways will cause compatibility trouble, so
they are unlikely to happen I guess. Oh, perhaps I should bring this
topic to Python 3000 list.

My proposed solution is to let __builtins__ point to dictionary
instead of module when module is imported.

-- 
Seo Sanghyeon



More information about the Ironpython-users mailing list