Python: Add type annotations

This commit is contained in:
Martin Thoma
2022-03-19 22:10:26 +01:00
committed by Alexander Wunschik
parent b95a514e84
commit 83b3dc402c
79 changed files with 509 additions and 461 deletions

View File

@@ -79,7 +79,7 @@ def get_valid_guess(guesses: int) -> str:
return guess
def build_result_string(num: List[str], guess: str):
def build_result_string(num: List[str], guess: str) -> str:
result = ""
# Correct digits in wrong place
@@ -105,10 +105,7 @@ def build_result_string(num: List[str], guess: str):
return result
######################################################################
def main():
def main() -> None:
# Intro text
print("\n Bagels")
print("Creative Computing Morristown, New Jersey")

View File

@@ -1,5 +1,5 @@
from bagels import build_result_string
def test_build_result_string():
def test_build_result_string() -> None:
build_result_string(["a", "b", "c"], "abc")