PyPy support breaking CPython compatibility?
Le 2018-01-31 ? 05:21, Ned Batchelder a ?crit?:
> On 1/30/18 3:58 PM, Etienne Robillard wrote:
>> Hi Ned,
>> Le 2018-01-30 ? 15:14, Ned Batchelder a ?crit?:
>>> I'm curious what you had to change for PyPy? (Unless it's a Py2/Py3
>>> thing as Chris mentions.)
>> Please take a look at the changesets:
>> In short, it seems PyPy automagically adds a __weakref__ attribute to
>> __slots__, causing the CPython interpreter to raise a TypeError...
> PyPy and CPython are separate implementations, that never mix: you run
> your code in one, or in the other.? How can PyPy do something at
> runtime (add a __weakref__ attribute to __slots__) that can cause
> CPython to do something at runtime (raise a TypeError)?
Sorry Ned for the confusion. This is strictly a PyPy issue. CPython does
not raise a TypeError.
> A small demonstration case would be very helpful for figuring out what
> is going on.
The problem is with the following code on PyPy 5.9:
? __slots__ = ['__weakref__',]
tkadm30 at yandex.com