Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/maincheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.11, 3.12, 3.13]
python-version: [3.11, 3.12, 3.13, 3.14]
steps:
- uses: actions/setup-python@v4
with:
Expand All @@ -40,7 +40,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.13'
python-version: '3.14'
cache: 'pip'
- name: Install dependencies
run: |
Expand All @@ -63,7 +63,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.13'
python-version: '3.14'
cache: 'pip'
- name: Install dependencies
run: |
Expand All @@ -83,7 +83,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.13'
python-version: '3.14'
cache: 'pip'
- name: Install dependencies
run: |
Expand Down
2 changes: 1 addition & 1 deletion music21/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
If you have the wrong version there are several options for getting
the right one.

- 1. (Best) Upgrade to a recent version of Python 3 (such as 3.13).
- 1. (Best) Upgrade to a recent version of Python 3 (such as 3.14).

The great features there will more
than make up for the headache of downloading
Expand Down
20 changes: 18 additions & 2 deletions music21/pitch.py
Original file line number Diff line number Diff line change
Expand Up @@ -2103,6 +2103,8 @@ def __lt__(self, other) -> bool:
>>> a < b
True
'''
if not isinstance(other, Pitch):
return NotImplemented
if self.ps < other.ps:
return True
else:
Expand Down Expand Up @@ -2133,7 +2135,12 @@ def __le__(self, other) -> bool:
Do not rely on this behavior -- it may be changed in a future version
to create a total ordering.
'''
return self.__lt__(other) or self.__eq__(other)
lt_result = self.__lt__(other)
if lt_result is NotImplemented:
return NotImplemented
if lt_result:
return True
return self.__eq__(other)

def __gt__(self, other) -> bool:
'''
Expand All @@ -2145,6 +2152,9 @@ def __gt__(self, other) -> bool:
>>> a > b
False
'''
if not isinstance(other, Pitch):
return NotImplemented

if self.ps > other.ps:
return True
else:
Expand Down Expand Up @@ -2177,7 +2187,13 @@ def __ge__(self, other) -> bool:
Do not rely on this behavior -- it may be changed in a future version
to create a total ordering.
'''
return self.__gt__(other) or self.__eq__(other)
gt_result = self.__gt__(other)
if gt_result is NotImplemented:
return NotImplemented
if gt_result:
return True

return self.__eq__(other)

# --------------------------------------------------------------------------
@property
Expand Down