STINNER Victor <victor.stin...@gmail.com> added the comment: New patch replacing dictproxy() builtin type with collections.mappingview() type:
- dictproxy() type doesn't need to be a builtin type - it is not specific to dict so replace "dict" prefix with "mapping" - "view" is a better suffix than "proxy" to indicate that it is a read-only proxy - IMO collections is the best place for new containers I don't understand how collections types are called: should it be MappingView or mappingview? The code of mappingview is just moved to _collectionsmodule.c to avoid the creation of two short files. PyDictProxy_Type and PyDictProxy_New() are kept and still declared in descrobject.h for backward compatibility. I fixed the doc to indicate that mappingview methods operate on the *underlying mapping*. I also added test_views() test. TODO: - mappingview() constructor only accepts dict: it should accept any mapping - mappingview.copy() creates a dict, it should create a new object of the same type than the underlying mapping ---------- Added file: http://bugs.python.org/file25028/mappingview-3.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue14386> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com