A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2001-April/014066.html below:

[Pythonmac-SIG] __builtins__ a dictionary or a module?

[Python-Dev] Re: [Pythonmac-SIG] __builtins__ a dictionary or a module? [Python-Dev] Re: [Pythonmac-SIG] __builtins__ a dictionary or a module?Jack Jansen jack@oratrix.nl
Fri, 06 Apr 2001 10:50:24 +0200
Python-devvers, can anyone help with this behaviour?

> If I run Just's Python IDE and run the same code it tells mes that
> __builtins__ is a module.
> 
> And finally if I run the following code from within the Interactive console
> contained in standard 'code.py' file I get told __builtins__ is a
> dictionary.
> 
> So what is it? Is __builtins__ a module or a dictionary? I know that they're
> essentially the same thing, but it unnerves me to have the same code produce
> different results in different platforms.

Well, I've narrowed down the difference to the exec statement:
>>> exec "print type(__builtins__)"
<type 'module'>
>>> exec "print type(__builtins__)" in {}
<type 'dictionary'>

Can anyone explain what is going on here?
--
Jack Jansen             | ++++ stop the execution of Mumia Abu-Jamal ++++
Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++
www.oratrix.nl/~jack    | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm 





RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4