Skip to content

__hash__ = None generates an error #4266

Open
@bmerry

Description

@bmerry

In mypy 0.550 with --strict-optional, defining an unhashable class like so:

class Foo:
    __hash__ = None

gives

hash.py:2: error: Incompatible types in assignment (expression has type "None", base class "object" defined the type as "Callable[[object], int]")

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions