i mean, i’m all for rejiggering the internals. i’ve personally written at least two libraries that uses type annotations in reverse to force arguments into the correct type, and i feel like that should probably be a separate mechanism to “just call the annotation”
i mean, i’m all for rejiggering the internals. i’ve personally written at least two libraries that uses type annotations in reverse to force arguments into the correct type, and i feel like that should probably be a separate mechanism to “just call the annotation”
dataclasses do this for you at the class level. They enforce type annotations at instantiation.
https://docs.python.org/3/library/dataclasses.html