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 pekka.klarck
Recipients gvanrossum, levkivskyi, pekka.klarck
Date 2018-09-05.14:35:57
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1536158157.36.0.56676864532.issue34568@psf.upfronthosting.co.za>
In-reply-to
Content
Thanks for the PEP-560 reference. It explains the reasoning for the underlying changes, performance, and also mentions backwards incompatibility problems, including `issubclass(List[int], List)` causing a TypeError. It doesn't mention that `issubclass(List, list)` also raises a TypeError, though, nor that `isinstance(List, type)` now returns False.

I understand changing the implementation for performance reason, but I don't understand why that would require changing the behavior of `isinstance` and `issubclass`. The PEP explicitly mentions that the new `types.resolved_base` isn't called by them without explaining why. I guess that could be for performance reasons, but even then types in the typing could themselves implement `__instancecheck__` and `__subclasscheck__` and retain the old behavior. Or is there some actual reason for changing the behavior?
History
Date User Action Args
2018-09-05 14:35:57pekka.klarcksetrecipients: + pekka.klarck, gvanrossum, levkivskyi
2018-09-05 14:35:57pekka.klarcksetmessageid: <1536158157.36.0.56676864532.issue34568@psf.upfronthosting.co.za>
2018-09-05 14:35:57pekka.klarcklinkissue34568 messages
2018-09-05 14:35:57pekka.klarckcreate