Python: Add type annotations to all 'print' functions (#662)

* Add test to superstartrek and fixes several issues in superstartrek - I probably introduced them 🙈
* Mastermind type annotations
This commit is contained in:
Martin Thoma
2022-03-21 10:41:14 +01:00
committed by GitHub
parent c444da93c0
commit 1b1d50986b
50 changed files with 241 additions and 172 deletions

View File

@@ -8,7 +8,7 @@ class Disk:
def size(self):
return self.__size
def print(self):
def print(self) -> None:
print("[ %s ]" % self.size())
@@ -39,7 +39,7 @@ class Tower:
raise Exception("empty pop")
return self.__disks.pop()
def print(self):
def print(self) -> None:
r = "Needle: [%s]" % (", ".join([str(x.size()) for x in self.__disks]))
print(r)
@@ -63,7 +63,7 @@ class Game:
def winner(self):
return self.__towers[0].empty() and self.__towers[1].empty()
def print(self):
def print(self) -> None:
for t in self.__towers:
t.print()