Skip to content

Builtins are incorrectly hinted as unhashable #10424

Closed
@TheTripleV

Description

@TheTripleV

I believe this was partially introduced by #8465. I ran into this issue while looking into microsoft/pyright#5446.

According to the python docs, a type that redefines __eq__ but not __hash__ is unhashable.

In the current typeshed hints, many types explicitly define __eq__ (int for example) but do not define hash. A type checker could incorrectly assume that the type is unhashable because of this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions