Message254153
__builtins__ is a private implementation detail in CPython. There is no guarantees made about whether it exists or not. E.g. it doesn't exist in Jython.
steve@orac:~/python$ jython
Jython 2.5.1+ (Release_2_5_1, Aug 4 2010, 07:18:19)
[OpenJDK Server VM (Sun Microsystems Inc.)] on java1.6.0_31
Type "help", "copyright", "credits" or "license" for more information.
>>> __builtins__
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name '__builtins__' is not defined
You should use `__builtin__` in Python 2 and `builtins` in Python 3. *Anything* you do to `__builtins__` with an S is implementation-dependent.
I don't think it is a bug that CPython behaves differently regarding __builtins__ depending on whether IDLE is running or not. |
|
Date |
User |
Action |
Args |
2015-11-06 00:59:46 | steven.daprano | set | recipients:
+ steven.daprano, ppperry |
2015-11-06 00:59:46 | steven.daprano | set | messageid: <1446771586.43.0.0302074492648.issue25564@psf.upfronthosting.co.za> |
2015-11-06 00:59:46 | steven.daprano | link | issue25564 messages |
2015-11-06 00:59:46 | steven.daprano | create | |
|