Skip to content

Comparing ImmutableObjects yields unexpected results  #837

@tkem

Description

@tkem

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')

Metadata

Metadata

Assignees

Labels

A-coreArea: Core layer

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions