[New-bugs-announce] [issue4582] type of __builtins__ changes if in main module or not

Neal Norwitz report at bugs.python.org
Sun Dec 7 21:48:39 CET 2008

New submission from Neal Norwitz <nnorwitz at gmail.com>:

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.

components: Interpreter Core
messages: 77252
nosy: nnorwitz
severity: normal
status: open
title: type of __builtins__ changes if in main module or not
type: behavior

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list