Skip to content

Commit

Permalink
add some casts for PyCharm
Browse files Browse the repository at this point in the history
Not a problem in mypy but PyCharm is complaining that "all" is still possible.
  • Loading branch information
mscuthbert committed Jan 2, 2024
1 parent 59b2feb commit 463dc24
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion music21/converter/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# Authors: Michael Scott Asato Cuthbert
# Christopher Ariza
#
# Copyright: Copyright © 2009-2015 Michael Scott Asato Cuthbert
# Copyright: Copyright © 2009-2024 Michael Scott Asato Cuthbert
# License: BSD, see license.txt
# ------------------------------------------------------------------------------
'''
Expand Down Expand Up @@ -475,6 +475,7 @@ def unregisterSubConverter(
_deregisteredSubConverters.append('all')
return

removeSubConverter = cast(Type[SubConverter], removeSubConverter)
try:
_registeredSubConverters.remove(removeSubConverter)
except ValueError:
Expand Down Expand Up @@ -927,6 +928,7 @@ def subConvertersList(
if unregistered == 'all':
continue
try:
unregistered = cast(Type[SubConverter], unregistered)
subConverterList.remove(unregistered)
except ValueError:
pass
Expand Down

0 comments on commit 463dc24

Please sign in to comment.