You'd like to improve the maintainability of a #Python code base that has no tests or type hints.

Which do you do?

Add type hints first, then automated tests
37.2%
Add tests first, then type hints
44.5%
Just add type hints
3.7%
Just add tests
14.6%
Poll ended at .
@treyhunner I picked types then tests, because I found it easier to add in types (especially all at once using MonkeyType).
Then, those types can be used to help you write tests.
Whether that actually helps improve maintainability faster than the other way round is something I'd be keen to know!
@treyhunner I thought about this a bit more and realised that if you write tests first, you could run MonkeyType over the execution of the tests instead of the entire execution, with the benefit being that the types are what you defined them to be, rather than what they might become via error.
Depends on the situation I guess!