Skip to content

__hash__ methods broken #2506

Closed
Closed

Description

@felixwang9817

Expected Behavior

The __hash__ methods should not be implemented like this:

def __hash__(self) -> int:
    return hash((id(self), self.name))

Objects with the __hash__ method implemented in such a way are not being deduplicated correctly in e.g. sets and dicts.

Current Behavior

Steps to reproduce

Specifications

  • Version:
  • Platform:
  • Subsystem:

Possible Solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions