▲ | Myrmornis 9 hours ago | |||||||||||||||||||
Can you give some examples of how the Python type system is disappointing you? | ||||||||||||||||||||
▲ | CJefferson 2 hours ago | parent | next [-] | |||||||||||||||||||
Mainly, the seems to be no way, in a dynamic language, to dynamically check if functions get the right types. To me, this means I don't really understand the python type hinting at all, as adding hints to just one or two functions provides no value to me at all. I assume I must be not using them usefully, as I've tried adding type hints to some projects and they just seemed to do nothing useful. | ||||||||||||||||||||
| ||||||||||||||||||||
▲ | colemannerd 2 hours ago | parent | prev [-] | |||||||||||||||||||
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. | ||||||||||||||||||||
|