Comment

Comment by singularity2001

Sorry for posting this issue here:

python3 type_annotations.py

    def sum_and_stringify(nums: List[int]) -> str:  
NameError: name 'List' is not defined

EDIT: Solved: Either just list or List[int] with import:

from typing import List

Thanks for all the help guys! By the way I took the example from the mypy page. A classical case of 'critical line missing from example code' (as perfectioned by Bjarne Stroustrup back when)

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton