[pypy-issue] Issue #2079: Behavior difference from CPython with mixins and __weakref__ (pypy/pypy)

Alex Gaynor issues-reply at bitbucket.org
Mon Jul 13 05:13:44 CEST 2015


New issue 2079: Behavior difference from CPython with mixins and __weakref__
https://bitbucket.org/pypy/pypy/issues/2079/behavior-difference-from-cpython-with

Alex Gaynor:

Given this code:

```python
class _BaseAddress(object):
    pass


class _BaseV4(object):
    __slots__ = ()


class IPv4Address(_BaseV4, _BaseAddress):
    __slots__ = ('__weakref__',)
```

CPython 2.7.10 has no problem, but PyPy gives:

```pytb
Traceback (most recent call last):
  File "<builtin>/app_main.py", line 75, in run_toplevel
  File "ipaddress.py", line 9, in <module>
    class IPv4Address(_BaseV4, _BaseAddress):
TypeError: __weakref__ slot disallowed: we already got one
```

This breaks the `ipaddress` package from PyPI.




More information about the pypy-issue mailing list