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

Created on 2012-02-29 18:05 by haypo, last changed 2012-03-26 20:22 by haypo. This issue is now closed.

Files
File name Uploaded Description Edit
frozendict.patch haypo, 2012-02-29 18:15 review
frozendict_builtins.patch haypo, 2012-03-01 00:44 review
type_final.patch haypo, 2012-03-01 12:58 review
Messages (5)
msg154655 - (view) Author: STINNER Victor (haypo) * (Python committer) Date: 2012-02-29 18:04
Patch to implement the PEP 416.
msg154656 - (view) Author: STINNER Victor (haypo) * (Python committer) Date: 2012-02-29 18:20
There is no documentation update yet.
msg154670 - (view) Author: STINNER Victor (haypo) * (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 (haypo) * (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.

Example:

>>> 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 (haypo) * (Python committer) Date: 2012-03-26 20:22
The PEP has been rejected. See issue #14386 for a new mappingview type.
History
Date User Action Args
2012-03-26 20:22:50hayposetstatus: open -> closed
resolution: fixed
messages: + msg156866
2012-03-01 12:58:33hayposetfiles: + type_final.patch

messages: + msg154690
2012-03-01 00:44:26hayposetfiles: + 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:02hayposetmessages: + msg154656
2012-02-29 18:15:19hayposetfiles: + frozendict.patch
2012-02-29 18:08:42hayposetfiles: - frozendict.patch
2012-02-29 18:05:03haypocreate