mutwo-org/mutwo.music

Can't compare `JustIntonationPitch` with other pitches

Closed this issue · 3 comments

>>> music_parameters.JustIntonationPitch('3/1') > music_parameters.WesternPitch()
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Input In [4], in <cell line: 1>()
----> 1 music_parameters.JustIntonationPitch('3/1') > music_parameters.WesternPitch()

File /nix/store/hhk4wr7hwry854sq69chmrjqyi964p7y-python3-3.10.9/lib/python3.10/functools.py:91, in _gt_from_lt(self, other, NotImplemented)
     89 def _gt_from_lt(self, other, NotImplemented=NotImplemented):
     90     'Return a > b.  Computed by @total_ordering from (not a < b) and (a != b).'
---> 91     op_result = type(self).__lt__(self, other)
     92     if op_result is NotImplemented:
     93         return op_result

File /nix/store/9vxq4s7k4fz1c1hc5jjrq4kalp2dy9fp-python3.10-mutwo.music/lib/python3.10/site-packages/mutwo/music_parameters/pitches/JustIntonationPitch.py:438, in JustIntonationPitch.__lt__(self, other)
    433 def __lt__(self, other: typing.Any) -> bool:
    434     match other:
    435         case music_parameters.abc.PitchInterval():
    436             return self.interval < other.interval
    437         case _:  # pitch test
--> 438             return super().__lt__(self, other)

TypeError: SingleNumberParameter.__lt__() takes 2 positional arguments but 3 were given

(wrong issue)

this was fixed with 7f414d5