pyyaml
pyyaml copied to clipboard
NOMERGE initial exploration with typehints, static typing with mypy
Made as part of understanding the repo to help when writing documentation of arguments.
Some typehints were inspired from the typeshed: https://github.com/python/typeshed/tree/b98cd0c3b0cc6ac25596c204930f2c69cd528540/stubs/PyYAML/yaml
tox -e lint should run mypy and have lots of unaddressed errors.
Some errors include:
Nonecomparisons - Py3 would failNone > 0- Coarse typehint of
IO[str]|IO[bytes]| str | bytes is a bit funky - various errors due to use of
Nonedefault
black was autoformatting so I've re-worked the commits so there is 1 autoformat commit, followed by a commit with the actual typehints being added.