Re:Why Today's Python Developers Are Embracing Type Hints
by a_t48 on Sunday September 28, 2025 @12:51AM
(#45401867)
Has anyone had good luck with auto-annotation of types of existing codebases? Either via LLM or via various runtime hooks? I work in a codebase that started off in Python 2 and isn't annotated with types in the majority of places, and I feel the pain every time I have to wonder what exactly the arguments to a method is.
[ Parent
| on HN ]
Re:Why Today's Python Developers Are Embracing Type Hints
by EdwardDiego on Sunday September 28, 2025 @01:03AM
(#45401903)
Yep, I've used this pretty successfully, the ideal is to run it under realistic prod traffic over time to capture as many types as can flow into a given function, but a good set of unit/integration tests can also provide good coverage.
And if you re-use the same type store (SQLite DB) across multiple instrumented runs, you can further improve it.
Re:Why Today's Python Developers Are Embracing Type Hints
by emeryberger on Sunday September 28, 2025 @11:37PM
(#45410111)
RightTyper is much better in addition to running orders of magnitude faster.
https://github.com/RightTyper/RightTyper
(full disclosure, I am one of its authors).
Re:Why Today's Python Developers Are Embracing Type Hints
by EdwardDiego on Saturday October 04, 2025 @12:51AM
(#45470599)
I'll look into it, cheers!
Re:Why Today's Python Developers Are Embracing Type Hints
by EdwardDiego on Saturday October 04, 2025 @12:55AM
(#45470615)
Just looking at the README, I'm very excited as I have a Hackathon coming up and I am looking to bring more type love to a legacy Django codebase, and was going to utilise MonkeyType again, but this time I'll use this!