[issue32162] typing.Generic breaks __init_subclass__

Ilya Kulakov report at bugs.python.org
Tue Nov 28 18:54:31 EST 2017


Ilya Kulakov <kulakov.ilya at gmail.com> added the comment:

That's a better workaround:

    class X(typing.Generic[T]):
        def __init_subclass__(cls, **kwargs):
            super(typing.GenericMeta, cls).__setattr__('_gorg', cls)
            super().__init_subclass__(**kwargs)

----------

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


More information about the Python-bugs-list mailing list