In #88089 (comment)@gvanrossum suggested to set __class_getitem__ = None if we want to make a subclass of indexable class (like tuple or dict) non-indexable. Indeed, it causes indexing to raise a TypeError, but with general message: "'NoneType' object is not callable".
It could be improved.
The text was updated successfully, but these errors were encountered:
serhiy-storchaka commentedMay 1, 2022
In #88089 (comment) @gvanrossum suggested to set
__class_getitem__ = Noneif we want to make a subclass of indexable class (liketupleordict) non-indexable. Indeed, it causes indexing to raise a TypeError, but with general message: "'NoneType' object is not callable".It could be improved.
The text was updated successfully, but these errors were encountered: