Open averagehat opened 5 years ago
Maybe sh.py
can be typed by typing the __getattr__
as returning a function which takes kwargs of values Union[int,str,Path]
It wold be good to use Path
or an equivalent newtype exclusively (like in pipeline.py
, but not the case in pathos_sheet.py
). One consideration is that path.py
does not work with pyfakefs
which I will likely want to use for nice fast tests of the glue code. We may also want types like "OutPath" and "InPath."
Along these lines, use of IO[Any]
may be useful in avoiding a leak on pyfakefs
tests (where because pyfakefs
doesn't capture all filesystem operations, and something unintended happens on the real file system.
Unfortunately this PR includes python3 changes as well as the mypy changes, I think up to a58386c
The version upgrade was necessitated for convenient mypy type annotations
A couple things:
x: int = 3
pydantic
or something similar (https://github.com/samuelcolvin/pydantic/pull/391) because we can hide the constructor behind assertions that enforce other guarantees about the type (like extant_file)