Open
Description
This is related to #95589 due to underlying mechanism, but the behavior is distinct.
class C:
pass
class D(int, C):
pass
>>> c = C()
>>> weakref.ref(c)
<weakref at 0x7fa5b2af9c60; to 'C' at 0x7fa5b2e501c0>
>>> d = D()
>>> weakref.ref(d)
TypeError: cannot create weak reference to 'D' object
>>> isinstance(d, C)
True
If I can weakly reference an instance of C
, then I should be able to weakly reference an instance of D
. Instances of D
are instances of C