Skip to content

Handle __builtins__ both as dict and as module#54

Closed
singingwolfboy wants to merge 2 commits intoerikrose:masterfrom
singingwolfboy:master
Closed

Handle __builtins__ both as dict and as module#54
singingwolfboy wants to merge 2 commits intoerikrose:masterfrom
singingwolfboy:master

Conversation

@singingwolfboy
Copy link
Copy Markdown

According to http://docs.python.org/2/reference/executionmodel.html:

By default, when in the __main__ module, __builtins__ is the built-in module
__builtin__ (note: no 's'); when in any other module, __builtins__ is an alias
for the dictionary of the __builtin__ module itself.

Therefore, this code needs to account for both cases.

According to http://docs.python.org/2/reference/executionmodel.html:

    By default, when in the __main__ module, __builtins__ is the built-in module
    __builtin__ (note: no 's'); when in any other module, __builtins__ is an alias
    for the dictionary of the __builtin__ module itself.

Therefore, this code needs to account for both cases.
There are probably many other contributors missing...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants