__builtins__ in bpython

  • Thread starter chaouche yacine
  • Start date
C

chaouche yacine

Hi. In the standard pytohon interpreter and in ipython, __builtins__ is a module, but in bpython it's a dictionnary. Was it redefined ?
 
A

alex23

Hi. In the standard pytohon interpreter and in ipython, __builtins__ is amodule, but in bpython it's a dictionnary. Was it redefined ?

I'd say it's a result of however bpython works and this:

"By default, when in the __main__ module, __builtins__ is the built-in
module builtins; when in any other module, __builtins__ is an alias
for the dictionary of the builtins module itself. __builtins__ can be
set to a user-created dictionary to create a weak form of restricted
execution."

http://docs.python.org/3/reference/executionmodel.html#naming-and-binding

This is a guess, I've never used bpython, being really quite happy
with iPython. Your best bet would be to ask the bpython dev or log an
issue on its repository:

https://bitbucket.org/bobf/bpython/issues
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top