Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: unhashable type: 'Fingering' #31

Closed
virtualdvid opened this issue Oct 5, 2022 · 1 comment
Closed

TypeError: unhashable type: 'Fingering' #31

virtualdvid opened this issue Oct 5, 2022 · 1 comment

Comments

@virtualdvid
Copy link

I got this error trying to use a Beat instance as a key in a dictionary:

File ~/Documents/personal/GuitarProML/.venv/lib/python3.8/site-packages/guitarpro/models.py:69, in hashableAttrs.<locals>.hash_(self)
     [67](file:///Users/damolina/Documents/personal/GuitarProML/.venv/lib/python3.8/site-packages/guitarpro/models.py?line=66)         toEvolve[field.name] = new_value
     [68](file:///Users/damolina/Documents/personal/GuitarProML/.venv/lib/python3.8/site-packages/guitarpro/models.py?line=67) newSelf = attr.evolve(self, **toEvolve)
---> [69](file:///Users/damolina/Documents/personal/GuitarProML/.venv/lib/python3.8/site-packages/guitarpro/models.py?line=68) return origHash(newSelf)

File <attrs generated hash guitarpro.models.Beat>:2, in __hash__(self)
      [1](file:///%3Cattrs%20generated%20hash%20guitarpro.models.Beat%3E?line=0) def __hash__(self):
----> [2](file:///%3Cattrs%20generated%20hash%20guitarpro.models.Beat%3E?line=1)         return hash((
      [3](file:///%3Cattrs%20generated%20hash%20guitarpro.models.Beat%3E?line=2)                 -5048304449766878921,
      [4](file:///%3Cattrs%20generated%20hash%20guitarpro.models.Beat%3E?line=3)                 self.notes,
      [5](file:///%3Cattrs%20generated%20hash%20guitarpro.models.Beat%3E?line=4)                 self.duration,
      [6](file:///%3Cattrs%20generated%20hash%20guitarpro.models.Beat%3E?line=5)                 self.text,
...
     [18](file:///%3Cattrs%20generated%20hash%20guitarpro.models.NoteEffect%3E?line=17)                 self.trill,
     [19](file:///%3Cattrs%20generated%20hash%20guitarpro.models.NoteEffect%3E?line=18)                 self.vibrato,
     [20](file:///%3Cattrs%20generated%20hash%20guitarpro.models.NoteEffect%3E?line=19)             ))

TypeError: unhashable type: 'Fingering'

Name: PyGuitarPro
Version: 0.9.2
Python: 3.8.13

@Perlence
Copy link
Owner

Hey @virtualdvid, thanks for reporting!

Perlence added a commit that referenced this issue Feb 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants