import List??
At least this works: def sum_and_stringify(nums: list) -> str:
At least this works: def sum_and_stringify(nums: list) -> str:
How I found it: quick google search for "mypy validate list"
def sum_and_stringify(nums: list[int]) -> str:
TypeError: 'type' object is not subscriptableso either just list or List[int] with import, got it.
A classical case of 'critical line missing from example code' (as perfectioned by Bjarne Stroustrup back when)