Skip to content

__hash__ methods broken #2506

@felixwang9817

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions