ProtixIT / dataclass-binder

Python library to bind TOML data to dataclasses in a type-safe way
MIT License
13 stars 2 forks source link

Instantiate `Binder` instead of specializing it #14

Closed mthuurne closed 1 year ago

mthuurne commented 1 year ago

Up until now, the Binder class was specialized using a type argument (Binder[Config]) rather than instantiation (Binder(config)). The specialization complicates the code for no clear benefit. In fact, it had the disadvantage that use of a non-specialized Binder had to be flagged as an error at runtime instead of during type checking.

There is backwards compatibility code to support the old syntax for a while, but not necessarily all the way up to 1.0.