This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mdk
Recipients docs@python, mdk, xcombelle
Date 2016-11-30.22:17:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1480544248.17.0.651044035028.issue26363@psf.upfronthosting.co.za>
In-reply-to
Content
Hi Xavier,

> It is not the dictionary of builtin module, which is inserted in , but the current __builtin__ global 

It looks wrong, I'll even say the exact contrary: It _is_ the dictionary of builtin module which is inserted in, not the current __builtin__ global, with this proof:

$ ./python
Python 3.7.0a0 (default, Nov 29 2016, 11:20:17) 
[GCC 5.4.1 20161019] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> print(id(__builtins__), id(__builtins__.__dict__))
140325888797784 140325888840368
>>> eval("""print(id(__builtins__))""", {})
140325888840368


> the current __builtin__ global which happen to be normally the dictionnary of builtin.

That's not necessarily true, according to [the builtins doc](https://docs.python.org/dev/library/builtins.html):

> The value of __builtins__ is normally either this module or the value of this module’s __dict__ attribute.

Typically:
$ ./python
Python 3.7.0a0 (default, Nov 29 2016, 11:20:17) 
[GCC 5.4.1 20161019] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import builtins
>>> id(builtins), id(builtins.__dict__), id(__builtins__)
(139706743340120, 139706743382704, 139706743340120)

Here, __builtins__ is the module, not its dict.
History
Date User Action Args
2016-11-30 22:17:28mdksetrecipients: + mdk, docs@python, xcombelle
2016-11-30 22:17:28mdksetmessageid: <1480544248.17.0.651044035028.issue26363@psf.upfronthosting.co.za>
2016-11-30 22:17:28mdklinkissue26363 messages
2016-11-30 22:17:27mdkcreate