▲ | colemannerd 3 hours ago | |
default values! Since type hints are *hints*, it is difficult to set default values for complicated types. For instance, if you have lists, dicts, sets in the type signature, without a library like pydantic, it is difficult and non-standard. This becomes even more problematic when you start doing more complicated data structures. The configuration in this library starts to show the problems. https://koxudaxi.github.io/datamodel-code-generator/custom_t... The issue very much is a lack of a standard for the entire language; rather than it not being possible. | ||
▲ | alfons_foobar 2 hours ago | parent [-] | |
I might be dense, but I don't understand what that has to do with type hints... To my eyes, the problem of choosing useful defaults for complicated types/datastructures is independent of whether I add type hints for them. I think I am missing something... |