News for hackers. Stuff that matters.
Re:Python type hints may not be not for me in practice by Hackbraten on Wednesday November 27, 2024 @06:06AM (#42255054)
> Type hints are nice, until you have to interact with a library that isn't type-hinted, and then it very quickly becomes a mess.

Whenever I find myself in that situation, I usually write a typing stub for the parts that I use from that library (example: [0]) and then let `mypy_path` point to that directory [1].

VS Code will then pick up the hints from those stubs.

[0]: https://github.com/claui/itchcraft/blob/5ca04e070f56bf794c38...

[1]: https://github.com/claui/itchcraft/blob/5ca04e070f56bf794c38...

There are no comments on this comment yet.