wickman / pystachio

type-checked dictionary templating library for python
MIT License
91 stars 22 forks source link

pystachio integrates poorly with mypy types #35

Open dgoldstein0 opened 5 years ago

dgoldstein0 commented 5 years ago

Today, the interface for using pystachio configs makes it rather hard if not impossible to type with mypy types. The most obvious stumbling block is that the schema, while looking like valid python code, must be read as a file and passed to pystachio.config.Config() as text, instead of as an actual python object.

I'm curious, why was this interface chosen instead of letting the schema just be a python object that could be passed along? in that case we'd at least have a chance of being able to give this useful mypy types.