This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author wrmsr
Recipients Ilya.Kulakov, levkivskyi, wrmsr
Date 2018-04-02.20:08:48
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1522699728.43.0.467229070634.issue32162@psf.upfronthosting.co.za>
In-reply-to
Content
I believe I'm experiencing a related bug in the new (3.7) version unfortunately. The current version of typing.Generic.__init_subclass__ isn't chaining to super(Generic, cls).__init_subclass__, meaning Generic's position in class bases can prevent subsequent bases from working properly. I can currently work around it with this unsightly hack but it's obviously suboptimal:

    _old_generic_init_subclass = object.__getattribute__(ta.Generic, '__init_subclass__').__func__
    @classmethod  # noqa
    def _new_generic_init_subclass(cls, *args, **kwargs):  # noqa
        _old_generic_init_subclass(cls, *args, **kwargs)
        super(ta.Generic, cls).__init_subclass__(*args, **kwargs)
    ta.Generic.__init_subclass__ = _new_generic_init_subclass  # noqa
History
Date User Action Args
2018-04-02 20:08:48wrmsrsetrecipients: + wrmsr, Ilya.Kulakov, levkivskyi
2018-04-02 20:08:48wrmsrsetmessageid: <1522699728.43.0.467229070634.issue32162@psf.upfronthosting.co.za>
2018-04-02 20:08:48wrmsrlinkissue32162 messages
2018-04-02 20:08:48wrmsrcreate