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.

Author vstinner
Recipients gvanrossum, vstinner
Date 2012-03-22.01:50:02
SpamBayes Score 7.4123534e-05
Marked as misclassified No
Message-id <1332381004.13.0.167648412562.issue14386@psf.upfronthosting.co.za>
In-reply-to
Content
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]
2
>>> 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).
History
Date User Action Args
2012-03-22 01:50:04vstinnersetrecipients: + vstinner, gvanrossum
2012-03-22 01:50:04vstinnersetmessageid: <1332381004.13.0.167648412562.issue14386@psf.upfronthosting.co.za>
2012-03-22 01:50:03vstinnerlinkissue14386 messages
2012-03-22 01:50:03vstinnercreate