[New-bugs-announce] [issue14386] Expose dictproxy as a public type

STINNER Victor report at bugs.python.org
Thu Mar 22 02:50:04 CET 2012

New submission from STINNER Victor <victor.stinner at gmail.com>:

Attached patch makes the dictproxy type public. Example:

$ ./python 
Python 3.3.0a1+ (default:059489cec7b9+, Mar 22 2012, 02:45:36) 
>>> d=dictproxy({1:2})
>>> d
dict_proxy({1: 2})
>>> d[1]
>>> d[1]=3
TypeError: 'dictproxy' object does not support item assignment
>>> del d[1]
TypeError: 'dictproxy' object doesn't support item deletion
>>> d.copy()
{1: 2}
>>> dir(d)
[..., '__getitem__', 'copy', 'get', 'items', 'keys', 'values']

The patch doesn't have any test or documentation yet.

See also the (now rejected) PEP 416 (frozendict).

components: Interpreter Core
files: dictproxy.patch
keywords: patch
messages: 156536
nosy: gvanrossum, haypo
priority: normal
severity: normal
status: open
title: Expose dictproxy as a public type
versions: Python 3.3
Added file: http://bugs.python.org/file24990/dictproxy.patch

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list