4 ms·
i am actually pretty sad that TypedDict has made it out of typing_extensions in its current state. It was a major missed opportunity to provide a properly duck
by ledauphin 7y ago
i am actually pretty sad that TypedDict has made it out of typing_extensions in its current state.
It was a major missed opportunity to provide a properly duck-typed Dict type, which by definition would allow untyped key-value pairs to be added to a "partially-typed" dictionary.
Gradual typing in general is a massive win for many kinds of real-world problem solving, but when you make it as hard as Python has to introduce partial types to a plain data object, you're leaving a lot of developers out in the cold.
I love MyPy and the static type hints since 3.6, but structural subtyping is superior and so obviously more Pythonic than nominal, yet support for structural subtyping keeps lagging behind.