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

@@ -14,7 +14,13 @@
import random
from math import sqrt
from typing import Any, List
from typing import Any, Callable, Dict, List
# Global variables
restart = False
s = 0
e = 0
d: List[int] = []
# -------------------------------------------------------------------------
# Utility functions
@@ -923,10 +929,10 @@ def end_game(won=False, quit=True, enterprise_killed=False):
# -------------------------------------------------------------------------
def main():
def main() -> None:
global restart
f = {
f: Dict[str, Callable[[], None]] = {
"NAV": navigation,
"SRS": short_range_scan,
"LRS": long_range_scan,

View File

@@ -139,7 +139,7 @@ def print_instructions():
print(" GALACTIC REGIONS REFERRED TO IN THE GAME.")
def main():
def main() -> None:
print_header()
if not get_yes_no("DO YOU NEED INSTRUCTIONS (Y/N)? "):
return