py_trees icon indicating copy to clipboard operation
py_trees copied to clipboard

Make type checking even more rigorous

Open jbcpollak opened this issue 3 years ago • 0 comments

This PR enables "check_untyped_defs" which allows mypy to check functions (defs) that don't have explicit typing in their headers. This found many issues, which I resolved, mostly in good ways, sometimes with a hammer. Once merged, I believe this additional type checking will help encourage better code structure, there are aspects of the code that become apparent now with the type checking that could be refactored to be cleaner in the future.

I actually found a few bugs (mostly around logging) as a result, and the code is overall a bit more rigorous with assertions and type checking.

Note: This PR builds on top of https://github.com/splintered-reality/py_trees/pull/338, so for ease of review I'd recommend merging that PR first, then this one. This one is really only a single commit, but shows as many because the other PR is not yet merged. Once merged, it will be a cleaner diff.

jbcpollak avatar Jun 03 '21 15:06 jbcpollak