Re:Static types in Python
by ddfisher on Thursday October 13, 2016 @05:54PM
(#12704372)
Good question! There are separate capitalized types for List, Dict, etc provided as part of the `typing` module in order to let you specify element types. Types are all normal Python expressions, so if you wrote `list[int]` you'd get a runtime error, because `type` objects (i.e. the `list` class) aren't subscriptable.
[ Parent
| on HN ]
There are no comments on this comment yet.