This address issues #19 and #23, providing a typed dataclass for the Enting parameters, as well as a helper function for constructing from a dictionary (to not break existing uses). I haven't changed the bulk of the Enting code to use this dataclass since I wanted to first see whether this approach is the best. Some alternatives that I considered that don't work as well as dataclasses:
TypedDict - this doesn't support default values
namedtuple - this isn't really designed for large structured objects, and would be quite clunky to use.
pydantic - this would provide much stronger typing, however it would require a lot of effort to implement for the whole project.
other pip modules - there are a few modules out there that do something similar, but I didn't want to add more dependencies to the project.
This address issues #19 and #23, providing a typed
dataclass
for the Enting parameters, as well as a helper function for constructing from a dictionary (to not break existing uses). I haven't changed the bulk of the Enting code to use this dataclass since I wanted to first see whether this approach is the best. Some alternatives that I considered that don't work as well as dataclasses:TypedDict
- this doesn't support default valuesnamedtuple
- this isn't really designed for large structured objects, and would be quite clunky to use.pydantic
- this would provide much stronger typing, however it would require a lot of effort to implement for the whole project.Let me know what you think!