[pypy-issue] Issue #2150: Behavior of inspect.isbuiltin differs between PyPy and CPython (pypy/pypy)

Richard Futrell issues-reply at bitbucket.org
Sat Oct 3 21:11:50 CEST 2015


New issue 2150: Behavior of inspect.isbuiltin differs between PyPy and CPython
https://bitbucket.org/pypy/pypy/issues/2150/behavior-of-inspectisbuiltin-differs

Richard Futrell:

I have some code that relies on `insect.isbuiltin` returning `True` for the `__getitem__` method of a dict. But PyPy returns `False`, differing from the behavior of CPython.

In PyPy:

```python
Python 2.7.9 (9c4588d731b7fe0b08669bd732c2b676cb0a8233, Mar 31 2015, 07:55:22)
[PyPy 2.5.1 with GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>> d = {}
>>>> import inspect
>>>> inspect.isbuiltin(d.__getitem__)
False
```

In CPython:

```python
Python 2.7.9 (default, Apr  9 2015, 12:34:21)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> d = {}
>>> import inspect
>>> inspect.isbuiltin(d.__getitem__)
True
```




More information about the pypy-issue mailing list