D-Man wrote: > So what is the difference between __builtin__ and __builtins__? __builtin__ is a module, __builtins__ is a module-level attribute that usually (but not always) points to that module. in CPython, if you ask for a global name that doesn't exist, Python looks for a __builtins__ module variable. if it is present, Python looks for the global name in there. if __builtins__ doesn't exist, CPython does an "import __builtin__ as __builtins__", and looks again. this is a performance optimization, but more importantly, it allows you to use your own __builtins__ dictionary when executing foreign code. > Why does CPython make __builtins__ visible by default and > Jython doesn't? Since messing with __builtins__ like this isn't > really a good idea, it seems that Jython is better for not > makeing __builtins__ so readily accessible. since this behaviour is documented in the language reference, this looks like a bug in jython... Cheers /F
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