type(__builtins__) strangeness

Michael Hudson mwh at python.net
Sat Nov 10 15:47:47 CET 2001

tavis at calrudd.com (Tavis Rudd) writes:

> Hi, 
> why does type(__builtins__) return <type 'module'> when called in the
> __main__ scope and <type 'dictionary'> when called inside an imported
> module?

Beause it's specially designed to confuse people who are too
inquisitive :)

Seriously, I don't know, but I know that I don't need to know.
Obscure implementation detail.  Ignore it.


  Finding a needle in a haystack is a lot easier if you burn down
  the haystack and scan the ashes with a metal detector.
      -- the Silicon Valley Tarot (another one nicked from David Rush)

More information about the Python-list mailing list