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
{{ message }}
Repository navigation
PyPy compatibility - __builtin__ is not iterable #8330
On PyPy builtins[key] should be builtins.key, which is also CPython compatible. This is a continuation of the fix(es) in issues #7186, #7272
lib/matplotlib/axes/axes.py line 6105
lib/matplotlib/axes/_axes.py line 6477 range = __builtins__['range'] -> range = __builtins__.range
For reference, this turned up in testing pandas/tests/plotting
Note that it's more complicated. __builtins__ can be a (regular) dictionary or a module object on CPython; on PyPy it is always a module object. It is documented as an internal detail and the proper solution is to not use it. Instead, do import __builtin__; range = __builtin__.range (or, in this case, just from __builtin__ import range).
Activity
arigo commentedon Mar 20, 2017
Note that it's more complicated.
__builtins__can be a (regular) dictionary or a module object on CPython; on PyPy it is always a module object. It is documented as an internal detail and the proper solution is to not use it. Instead, doimport __builtin__; range = __builtin__.range(or, in this case, justfrom __builtin__ import range).anntzer commentedon Mar 21, 2017
fixed by #8331.