Create new type: map (dictionary) with all support for it

This commit is contained in:
Bartłomiej Pluta
2019-07-09 00:11:39 +02:00
parent a3dfae73f1
commit d23e7a1276
17 changed files with 150 additions and 29 deletions

View File

@@ -44,7 +44,13 @@ class Note:
def __repr__(self):
return self.__str__()
def __eq__(self, other):
return self.note == other.note and self.octave == other.octave and self.duration == other.duration and self.dot == other.dot
def __hash__(self):
return hash(self.__str__())
@staticmethod
def checkInterval(a, b):
return b._intRepr() - a._intRepr()