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.

Title: type of __builtins__ changes if in main module or not
Type: behavior Stage:
Components: Interpreter Core Versions:
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: loewis, nnorwitz
Priority: normal Keywords:

Created on 2008-12-07 20:48 by nnorwitz, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg77252 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2008-12-07 20:48
This happens on 2.4 and 3.0, probably all versions:

When running this simple program (save to a file):


I get:
<type 'module'>
<type 'dict'>

I would expect the type to be consistent regardless of whether executing
the main module or from the imported module.  I haven't looked into why
this is happening or if it makes sense.  It was unexpected.
msg77254 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2008-12-07 20:57
This is documented, intentional behavior:
Date User Action Args
2022-04-11 14:56:42adminsetgithub: 48832
2008-12-07 20:57:07loewissetstatus: open -> closed
resolution: wont fix
messages: + msg77254
nosy: + loewis
2008-12-07 20:48:38nnorwitzcreate