Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error message for __class_getitem__ = None #92114

Closed
serhiy-storchaka opened this issue May 1, 2022 · 0 comments · Fixed by #92115
Closed

Improve error message for __class_getitem__ = None #92114

serhiy-storchaka opened this issue May 1, 2022 · 0 comments · Fixed by #92115
Labels
topic-typing type-feature A feature request or enhancement

Comments

@serhiy-storchaka
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic-typing type-feature A feature request or enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant