Skip to content

Improve error message for __class_getitem__ = None #92114

Closed

Description

@serhiy-storchaka

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.

Activity

  1. added a commit that references this issue on May 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions