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

Comparing ImmutableObjects yields unexpected results #837

Closed
tkem opened this Issue Aug 24, 2014 · 3 comments

Comments

3 participants
@tkem
Member

tkem commented Aug 24, 2014

mopidy.models.ImmutableObject has __eq__ and __ne__ methods, but they sometimes yield unexpected results:

For example, I expected the following to all yield True, since the respective attributes compare equal:

from mopidy.models import Track
Track(name='foo', album=None) == Track(name='foo')
Track(name='foo', album=None) == Track(name='foo', album=None, track_no=0)
Track(name='foo', album=None) == Track(name='bar', album=None).copy(name='foo')

@adamcik adamcik added this to the v0.20 - Audio cleanup milestone Sep 3, 2014

@adamcik adamcik added bug labels Sep 3, 2014

@jodal jodal self-assigned this Sep 22, 2014

@jodal jodal closed this in bdd1fb9 Sep 22, 2014

@tkem tkem referenced this issue Oct 24, 2014

Closed

Improve Unit Tests #4

@tkem

This comment has been minimized.

Member

tkem commented Nov 4, 2014

May I suggest this for the v0.19.5 milestone? Writing backend unit tests would be much more fun with this...

@jodal jodal modified the milestones: v0.19.5 - Bug fixes, v0.20 - Audio cleanup Nov 4, 2014

jodal added a commit that referenced this issue Nov 4, 2014

models: Fix equality for fields set to the default
Fixes #837

(cherry picked from commit bdd1fb9)
@jodal

This comment has been minimized.

Member

jodal commented Nov 4, 2014

Done :-)

@tkem

This comment has been minimized.

Member

tkem commented Nov 4, 2014

A small step for a man...

teq0 added a commit to teq0/mopidy that referenced this issue Feb 3, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment