Hash in DashDependency does not take class name into account
Open
Nobody has claimed this yet.
bug
P3
- Dominant language
- Python
- Stars
- 24.4k
- Forks
- 2.3k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 13
Description
In
the hash is implemented as
def __hash__(self):
hash(str(self))
where
def __str__(self):
return "{}.{}".format(self.component_id_str(), self.component_property)
def __repr__(self):
return "<{} `{}`>".format(self.__class__.__name__, self)
so that an Input and State with the same id would yield the same hash-value.
I plan to insert Input and State objects into a dict, and this could cause issues.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in dash/dependencies.py around line 27 and inspect how DashDependency, Input, and State define hash, str, and repr. Compare the dictionary behavior for Input and State instances with the same id and property, then add or update regression coverage so the class distinction is handled as intended.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 38/100