con2 / emrichen

A Template engine for YAML & JSON
MIT License
107 stars 11 forks source link

Add type annotations #36

Closed akx closed 3 years ago

akx commented 3 years ago

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().

japsu commented 3 years ago

There's some explicit Anys, can we leave them out?

japsu commented 3 years ago

@akx lgtm maybe?