Use frozensets in models as they are hashable
This commit is contained in:
parent
1e7fa943be
commit
949ca6357f
@ -70,7 +70,7 @@ class Album(ImmutableObject):
|
||||
num_tracks = 0
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
self._artists = set(kwargs.pop('artists', []))
|
||||
self._artists = frozenset(kwargs.pop('artists', []))
|
||||
super(Album, self).__init__(*args, **kwargs)
|
||||
|
||||
def __eq__(self, other):
|
||||
@ -135,7 +135,7 @@ class Track(ImmutableObject):
|
||||
id = None
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
self._artists = set(kwargs.pop('artists', []))
|
||||
self._artists = frozenset(kwargs.pop('artists', []))
|
||||
super(Track, self).__init__(*args, **kwargs)
|
||||
|
||||
def __eq__(self, other):
|
||||
|
||||
Loading…
Reference in New Issue
Block a user