3 ms·
The built-in constructor is `list`, not `List`.
by dcre 10y ago
The built-in constructor is `list`, not `List`.
- singularity2001 10y agoThanks for all the help guys! by the way I took the example from the mypy page def sum_and_stringify(nums: list[int]) -> str: TypeError: 'type' object is not subscriptable so 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)