Message324634
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? |
|
Date |
User |
Action |
Args |
2018-09-05 14:35:57 | pekka.klarck | set | recipients:
+ pekka.klarck, gvanrossum, levkivskyi |
2018-09-05 14:35:57 | pekka.klarck | set | messageid: <1536158157.36.0.56676864532.issue34568@psf.upfronthosting.co.za> |
2018-09-05 14:35:57 | pekka.klarck | link | issue34568 messages |
2018-09-05 14:35:57 | pekka.klarck | create | |
|