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

as your codebase and number of collaborators get larger, it's super useful to have the type checker be able to tell you "hey, you said your function arg could be a time or an int, but you are calling time-specific methods on it" or conversely "the function you are calling says it accepts time objects but you are passing it an int"

also once you get into jit compilation you can do some nice optimisations if you can treat a variable type as statically known rather than dynamic.

and finally, even if you're not writing python at scale it can be very nice to use the type annotations to document your function parameters.



> also once you get into jit compilation you can do some nice optimisations if you can treat a variable type as statically known rather than dynamic.

This is something I hadn't considered. Thanks for mentioning it :)




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

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

Search: