[issue25564] Document that IDLE -python difference for `del __builtins__`

Terry J. Reedy report at bugs.python.org
Thu Aug 25 02:18:19 EDT 2016


Terry J. Reedy added the comment:

What I meant is that one cannot use __builtin__ or builtins until one has done the import, which is why people tend not to bother and instead do things like ppperry was doing.

To the extent that tkinter is limited to CPython, so is IDLE.  Still, the only reference to __builtins__ is in
F:\Python\dev\36\lib\idlelib\autocomplete.py: 188: (fetch completions)
        namespace.update(__main__.__builtins__.__dict__)

I don't know why not just use __builtins__.__dict__, but this follows
    import __main__
        namespace = __main__.__dict__.copy()

To be cross-platform, you are saying that this should be on 3.x
    import builtins; namespace.update(builtins.__dict__)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue25564>
_______________________________________


More information about the Python-bugs-list mailing list