Closed RivenSkaye closed 2 years ago
These changes have been tried and tested btw, they all work on my system
They don't change required python versions or anything like that?
None of that whatsoever. I made all of the typing compatible with pre-3.10 Python versions.
The only thing 3.10 adds is alternative syntax for Optionals and Unions, where you can just specify typeA | typeB | None
which looks cleaner.
MyPy immediately screeched when I did that because I explicitly set it to check for 3.9 compatibility
Hold up, wait with the merge, I broke something
All's good again, I unbroke the subprocess.getoutput
call and fixed other minor issues
This adds proper typehints and passes typechecking with MyPy. That's a good thing because it means type safety in a dynamically typed language. It also makes it easier to see where errors originate from. Besides that I did some generic cleanup like removing unused imports and preventing re-assigning to a variable immediately after assigning an initial value wherever this could be prevented.