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

Regarding mypy growth, overall downloads of packages from PyPI has increased ~5x in the last 2 years, which explains part of the change, but it appears usage of type checkers is growing faster than that, which is an interesting trend.

A healthy ecosystem around a tool is important, especially a type checker since you want library authors to prioritize a good experience for your tool of choice. It is noteworthy here that ty adoption has grown significantly beyond the rates of other tools.

 help



Everyone coming from statically typed languages trying to build full-blown applications using Python pretty quickly figures out how to get static type checking in Python.

`mypy` has caught missed pieces of refactors that were simply never checked anywhere else. It’s found confusing type declarations and outright logic errors, way more than I thought it would in an otherwise well-structured and heavily annotated code base.


A codebase which is heavily annotated but not checked is not going to do much, it has some documentary value but that only goes so far, and in my experience editors will pretty quickly fallback to Any if they do anything at all.

I'd honestly argue that an annotated-but-unchecked codebase has negative documentary value -- it's so, so easy for the annotations to be incorrect or out-of-date if they're not checked in CI. So they often end up just being misleading and confusing

They do indicate intent, which can be useful. If possible I’d rather have that than docstring fields as it’s a start and the structure makes it easier to process and / or hide. For simple types anyway.

But if you start writing complex unions or typed dicts and nothing’s checked then yeah.




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

Search: