This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: PEP 416: Add a builtin frozendict type
Type: enhancement Stage:
Components: Interpreter Core Versions: Python 3.3
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: vstinner
Priority: normal Keywords: patch

Created on 2012-02-29 18:05 by vstinner, last changed 2022-04-11 14:57 by admin. This issue is now closed.

File name Uploaded Description Edit
frozendict.patch vstinner, 2012-02-29 18:15 review
frozendict_builtins.patch vstinner, 2012-03-01 00:44 review
type_final.patch vstinner, 2012-03-01 12:58 review
Messages (5)
msg154655 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2012-02-29 18:04
Patch to implement the PEP 416.
msg154656 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2012-02-29 18:20
There is no documentation update yet.
msg154670 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2012-03-01 00:44
frozendict_builtins.patch: make CPython supports frozendict for the __builtins__ mapping. It is an example of frozendict usage which helps my pysandbox project.
msg154690 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2012-03-01 12:58
Another frozendict usage example: freeze the dict of a new type if it contains __final__ in its namespace.


>>> class Classic:
...     pass
>>> Classic.attr=1
>>> class FinalizedType:
...     __final__=True
>>> FinalizedType.attr=1
TypeError: 'frozendict' object does not support item assignment

This patch is not part of the PEP 416 and is just a proof-of-concept.
msg156866 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2012-03-26 20:22
The PEP has been rejected. See issue #14386 for a new mappingview type.
Date User Action Args
2022-04-11 14:57:27adminsetgithub: 58370
2012-03-26 20:22:50vstinnersetstatus: open -> closed
resolution: fixed
messages: + msg156866
2012-03-01 12:58:33vstinnersetfiles: + type_final.patch

messages: + msg154690
2012-03-01 00:44:26vstinnersetfiles: + frozendict_builtins.patch

messages: + msg154670
title: Implementation of the PEP 416 (Add a builtin frozendict type) -> PEP 416: Add a builtin frozendict type
2012-02-29 18:20:02vstinnersetmessages: + msg154656
2012-02-29 18:15:19vstinnersetfiles: + frozendict.patch
2012-02-29 18:08:42vstinnersetfiles: - frozendict.patch
2012-02-29 18:05:03vstinnercreate