From 949ca6357f8055c6cd4a3147759b9a91765ad327 Mon Sep 17 00:00:00 2001 From: Thomas Adamcik Date: Wed, 28 Apr 2010 21:53:10 +0200 Subject: [PATCH] Use frozensets in models as they are hashable --- mopidy/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mopidy/models.py b/mopidy/models.py index 5f61f019..67b60840 100644 --- a/mopidy/models.py +++ b/mopidy/models.py @@ -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):