I am introducing PEP 764: Inlined typed dictionaries, available here:
Inlined typed dictionaries have been requested in the past. Some discussions for reference:
- Feedback: experimental syntax for inlined TypedDict · python/typing · Discussion #1391 · GitHub
- Anonymous and inline declaration of `TypedDict` types · Issue #9884 · python/mypy · GitHub
Note: Writing this PEP was initially done as part of a larger concept I’m trying to flesh out:
The idea would be to define a new concept on top of inlined TDs, that would allow creating dynamic and flexible TypedDict types (partial, omit, etc). The discussion raises issues about this concept, and in particular this comment suggesting to define a proper new syntax. Feel free to discuss this subject here as well, if you think inlined TDs could be defined using another syntax that would allow for this broader concept.
Thanks in advance for your feedback! (there are also open issues to discuss).
12 posts - 9 participants