6 ms·
https://docs.python.org/3/whatsnew/3.12.html#whatsnew312-pep692 https://docs.python.org/3/whatsnew/3.12.html#whatsnew312-pep... "PEP 692: Using TypedDict for mo
by flakes 3y ago
https://docs.python.org/3/whatsnew/3.12.html#whatsnew312-pep692 https://docs.python.org/3/whatsnew/3.12.html#whatsnew312-pep...
"PEP 692: Using TypedDict for more precise *kwargs typing" seems pretty great.
That'll be really helpful for nested method calls which proxy a lot of their arguments along. I can also see that helping out when creating stub libraries.
- chrismorgan 3y ago… but the Unpack[…] wrapping required is awful, required because they initially defined kwargs type annotations in a rather baffling way. (I don’t know about others, but it was obvious to me from the start that the way the *args and **kwargs type annotations refer to the sequence values rather than the args/kwargs bindings was always going to cause confusion, and was very likely to cause problems down the line when they wanted more precise typing; and that day has arrived for kwargs, no idea if they have any plans for similar on args, which is sometimes useful. They should just have required `*args: List[T], **kwargs: Dict[str, T]` from the start.)