Python 3.13: Fix and polish #1

Merged
vilmibm merged 15 commits from noelle/tilde-train:python-3.13 into trunk 2025-06-02 22:23:23 +00:00
Showing only changes of commit fc80d291ab - Show all commits

View File

@ -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