You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you create two FLAC objects from the same file, they compare equal but they do not have the same hash value.
This is annoying when, for instance, you use sets to find duplicates. And it also goes against python 'regulations':
from Python docs
"The only required property is that objects which compare equal have the same hash value"
This issue may also apply to other types, but I only tested this for FLAC.
>>> from mutagen.flac import FLAC
>>> path = "myflac.flac"
>>> f1 = FLAC(path)
>>> f2 = FLAC(path)
>>> f1 == f2
True
>>> hash(f1) == hash(f2)
False
The text was updated successfully, but these errors were encountered:
When you create two FLAC objects from the same file, they compare equal but they do not have the same hash value.
This is annoying when, for instance, you use sets to find duplicates. And it also goes against python 'regulations':
from Python docs
"The only required property is that objects which compare equal have the same hash value"
This issue may also apply to other types, but I only tested this for FLAC.
The text was updated successfully, but these errors were encountered: