Skip to content

Non-hashable types should declare __hash__: None in typeshed #2148

Closed
@ilevkivskyi

Description

@ilevkivskyi

Currently this passes mypy:

from typing import Hashable

def f(x: Hashable):
    pass

f([])

A possible solution may be to add __hash__: None to non-hashable types like list.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions