Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: