[issue41451] Class with __weakref__ slot cannot inherit from typing.Generic subclass

Joshua Bronson report at bugs.python.org
Fri Jul 31 21:45:58 EDT 2020


Joshua Bronson <jabronson at gmail.com> added the comment:

It turns out that this bug reproduces with any subclass of the generic type with a weakref slot, even without any multiple inheritance going on.

For example:

class Invertible2(Invertible[KT1, KT2]): pass

is enough to trigger this bug along with the Invertible class in my previous example. Attaching the more minimal repro with this comment, and renaming the issue to remove the reference to multiple inheritance.

----------
title: Class with __weakref__ slot cannot inherit from multiple typing.Generic classes -> Class with __weakref__ slot cannot inherit from typing.Generic subclass
Added file: https://bugs.python.org/file49353/bpo41451-repro.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41451>
_______________________________________


More information about the Python-bugs-list mailing list