# 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:** 48

<div class="post-metadata">

**Author:** ![Nineteendo](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/nineteendo/32/19122_2.png) [@Nineteendo](https://discuss.python.org/u/Nineteendo)\
**Post date:** [November 15, 2025, 8:37am UTC](https://discuss.python.org/t/pep-814-add-frozendict-built-in-type/104854/48 "2025-11-15T08:37:27Z")

</div>

> [@blhsing](#):
>
> I think it makes sense to optimize for the use case by adding a `dict.detach` method, which creates a frozendict that reuses the hashtable of the dict and make the original dict point to a new empty hashtable

If we execute `fd = frozendict(d)`, can’t we make make `d` point to the hash table of `fd` and only copy it when we add, change or remove a key (but not when we clear the dict). That would give us `O(1)` construction without changing the class and would also work for `d = dict(fd)`.

---

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