Skip to content
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

Equality changes -- hierarchy #1466

Merged
merged 6 commits into from
Oct 17, 2022
Merged

Equality changes -- hierarchy #1466

merged 6 commits into from
Oct 17, 2022

Conversation

mscuthbert
Copy link
Member

  • Add an equality hierarchy to music21 to enable easier development (needed for @MarkGotham PRs)
  • Add documentation for how equality and hashing work in music21
  • Add notes in dev documents about equality and hashing in music21 and why there are mistakes that can't be fixed.
  • Before there was a mishmash of which Music21Objects could be hashed. Aim for all to be able to -- with consequences on devs if they mutate them later.
  • Use deque in a few places where pop(0) was being used. Remove pop(False)

@mscuthbert mscuthbert closed this Oct 17, 2022
@mscuthbert mscuthbert reopened this Oct 17, 2022
@coveralls
Copy link

coveralls commented Oct 17, 2022

Coverage Status

Coverage increased (+0.03%) to 93.081% when pulling a91c0d9 on equality into b65b2f5 on master.

@mscuthbert mscuthbert merged commit d482896 into master Oct 17, 2022
@mscuthbert mscuthbert deleted the equality branch October 17, 2022 02:39
@mscuthbert
Copy link
Member Author

Fixes #1458

MarkGotham added a commit to MarkGotham/music21 that referenced this pull request Oct 19, 2022
cuthbertLab#1466 introduces a new `__eq__` syntax and highlights some failing tests on Time Signature as 'work in progress'. This commit implements that syntax and fixes (uncomments) those tests.

Possible remaining questions:
- Do we want `assertRaises` on the comparison of different classes or is False good (as here)?
- all and only the right checks in `core`?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants