# PEP 764: Inlined typed dictionaries

**URL:** <https://discuss.python.org/t/pep-764-inlined-typed-dictionaries/78779>\
**Category:** PEPs\
**Tags:** typing\
**Created:** [January 29, 2025, 9:10pm UTC](https://discuss.python.org/t/pep-764-inlined-typed-dictionaries/78779 "2025-01-29T21:10:43Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Viicos](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/viicos/32/14616_2.png) [@Viicos](https://discuss.python.org/u/Viicos)\
**Post date:** [January 29, 2025, 9:10pm UTC](https://discuss.python.org/t/pep-764-inlined-typed-dictionaries/78779/1 "2025-01-29T21:10:43Z")

</div>

I am introducing PEP 764: Inlined typed dictionaries, available here:

> **[PEP 764 – Inlined typed dictionaries | peps.python.org](https://peps.python.org/pep-0764/)**
>
> PEP 589 defines a class-based and a functional syntax to create typed dictionaries. In both scenarios, it requires defining a class or assigning to a value. In some situations, this can add unnecessary boilerplate, especially if the typed dictionary...

Inlined typed dictionaries have been requested in the past. Some discussions for reference:

- [Feedback: experimental syntax for inlined TypedDict · python/typing · Discussion #1391 · GitHub](https://github.com/python/typing/discussions/1391)
- [Anonymous and inline declaration of `TypedDict` types · Issue #9884 · python/mypy · GitHub](https://github.com/python/mypy/issues/9884)

* * *

Note: Writing this PEP was initially done as part of a larger concept I’m trying to flesh out:

- [Inlined typed dicts and typed dict comprehensions](https://discuss.python.org/t/68921)

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](https://discuss.python.org/t/68921) raises issues about this concept, and in particular [this comment](https://discuss.python.org/t/68921/8) 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](https://peps.python.org/pep-0764/#open-issues) to discuss).

---

_[View the full topic](https://discuss.python.org/t/pep-764-inlined-typed-dictionaries/78779)._
