You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed the type of builtins is a dict in bpython, where it is a module in Python. This means calling __builtins__, type(__builtins__) and dir(__builtins__) gives a completely different behavior.
Does anyone know why it is implemented like this in bpython?
And from Python's documentation of the builtinsmodule:
As an implementation detail, most modules have the name __builtins__ made available as part of their globals. The value of __builtins__ is normally either this module or the value of this module’s __dict__ attribute.
So we deviate from the default behavior, but it's inline with the documentation.
I noticed the type of builtins is a dict in bpython, where it is a module in Python. This means calling
__builtins__
,type(__builtins__)
anddir(__builtins__)
gives a completely different behavior.Does anyone know why it is implemented like this in bpython?
python:
bpython:
The text was updated successfully, but these errors were encountered: