Add type hints to function signatures
For better code intelligence
This commit is contained in:
parent
8441c6acfb
commit
fc80d291ab
@ -186,14 +186,14 @@ def test_user_car():
|
||||
print("PASS. Your train car will work on the tilde.town tracks! :)")
|
||||
sys.exit()
|
||||
|
||||
def link_car(car):
|
||||
def link_car(car: list[str]):
|
||||
for idx,row in enumerate(car):
|
||||
car[idx] = " " + row
|
||||
car[len(car)-3] = "+" + car[len(car)-3][1:]
|
||||
car[len(car)-2] = "+" + car[len(car)-2][1:]
|
||||
return car
|
||||
|
||||
def validate_car(car):
|
||||
def validate_car(car: list[str]):
|
||||
## this function (1) checks that a train car isn't too tall or too long
|
||||
## (2) pads it vertically or on the right side if it is too short or if
|
||||
## not all lines are the same length and (3) removes bad characters.
|
||||
@ -256,7 +256,7 @@ def print_all_cars():
|
||||
# print "Cannot open " + fname # for debuggering purposes
|
||||
|
||||
|
||||
def chuggachugga(stdscr):
|
||||
def chuggachugga(stdscr: curses.window):
|
||||
curses.curs_set(0)
|
||||
h, w = stdscr.getmaxyx()
|
||||
x_pos = w-1
|
||||
|
Loading…
x
Reference in New Issue
Block a user