Hacker News new | past | comments | ask | show | jobs | submit login

use mypy? it can enforce the type hints.



MyPy is awesome and will make you a more productive programmer and will make your application more robust. But I agree that Python types are "weak ass". It's not a particularly ergonomic type system to use, and it's more difficult to express complex types than is worth it for the sometimes questionable benefit.

3.10 does add unions using | which is nice, and I expect the type system will get better, but I share these frustrations.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: