Message156536
| 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:04 | vstinner | set | recipients:
+ vstinner, gvanrossum |
| 2012年03月22日 01:50:04 | vstinner | set | messageid: <1332381004.13.0.167648412562.issue14386@psf.upfronthosting.co.za> |
| 2012年03月22日 01:50:03 | vstinner | link | issue14386 messages |
| 2012年03月22日 01:50:03 | vstinner | create |
|