Add tests for using PEP560 with classes implemented in C. by serhiy-storchaka · Pull Request #4883 · python/cpython (original) (raw)

Thank you for adding these tests! I just have one suggestion to make the test closer to how these methods will be used in typical code. The idea is that there will be typically a pair of classes:

class Generic: def class_getitem(cls, item): return GenericAlias(item)

class GenericAlias: def init(self, item): self.item = item def mro_entries(self, bases): return (item,)

but this is just a minor suggestion, you can merge it as is if you prefer.