Initial type annotations were added with MonkeyType (monkeytype run -m pytest -ra & for module in (monkeytype list-modules | grep -v tests); monkeytype apply --sample-count $module; end), then cleaned up by hand to avoid some Union[...] monstrosities.
Some imports, mainly in context.py, had to be moved into function-locals to avoid circular imports.
In addition, pyupgrade was run to replace some old-school percent formatting with .format().
Initial type annotations were added with MonkeyType (
monkeytype run -m pytest -ra
&for module in (monkeytype list-modules | grep -v tests); monkeytype apply --sample-count $module; end
), then cleaned up by hand to avoid someUnion[...]
monstrosities.Some imports, mainly in
context.py
, had to be moved into function-locals to avoid circular imports.In addition,
pyupgrade
was run to replace some old-school percent formatting with.format()
.