# PEP 814: Add frozendict built-in type

**URL:** <https://discuss.python.org/t/pep-814-add-frozendict-built-in-type/104854>\
**Category:** PEPs\
**Tags:** builtins\
**Created:** [November 13, 2025, 9:53am UTC](https://discuss.python.org/t/pep-814-add-frozendict-built-in-type/104854 "2025-11-13T09:53:50Z")\
**Posts on this page:** 1\
**Showing post:** 37

<div class="post-metadata">

**Author:** ![Jelle](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/jelle/32/1049_2.png) [@Jelle](https://discuss.python.org/u/Jelle)\
**Post date:** [November 14, 2025, 12:13pm UTC](https://discuss.python.org/t/pep-814-add-frozendict-built-in-type/104854/37 "2025-11-14T12:13:19Z")

</div>

Yes, we’ll have to think about how this new builtin type (if it is accepted) interacts with TypedDict. (“We” here doesn’t necessarily mean the authors of PEP 814; this is something we can add separately later.)

Currently, TypedDict is specified as being restricted to instances of exactly `dict`: no subclasses, no other kinds of Mappings. So if we don’t change anything, frozendicts would not be compatible with TypedDict at all.

A few options:

1. Add `class TD(TypedDict, frozen=True):` (as Thomas suggests). I assume this would mean that it is like TypedDict, except it must be a frozendict instead of a dict. But probably lots of people will want to write APIs that can accept either a dict or a frozendict, not just one of the two. Another variant could be that `dict` is acceptable for `frozen=True`, but not the reverse. This makes some sense because `dict` mostly only adds functionality to `frozendict`. Except hashing.
2. Add some more general kind of `TypedMapping` that can contain any kind of `Mapping` with fixed keys. This has been suggested before but I don’t know if there’s been a design that is fully fleshed out.
3. Add some type qualifier like `Frozen[MyTypedDict]` that indicates a transformation of an existing TypedDict into a frozen one. Then naturally, `MyTypedDict | Frozen[MyTypedDict]` means you accept a dict in either thawing state.

We could also wait and see how widely adopted frozendict is going to be before we add type system support. This might create a bit of a chicken-and-egg problem though; people may be hesitant to start using it if they can’t use it with TypedDict.

---

_[View the full topic](https://discuss.python.org/t/pep-814-add-frozendict-built-in-type/104854)._
