Message254153
| Author |
steven.daprano |
| Recipients |
ppperry, steven.daprano |
| Date |
2015年11月06日.00:59:46 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1446771586.43.0.0302074492648.issue25564@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
__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. |
|
History
|
|---|
| 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 |
|