On 20Apr2014 20:12, Devin Jeanpierre <jeanpierr...@gmail.com> wrote:
On Sun, Apr 20, 2014 at 8:01 PM, Cameron Simpson <c...@zip.com.au> wrote:
Me too. I'm against iteritems and friends coming back.
I've been burned in the past with the burden of writing a mapping class with
the many methods such a thing must support; both items() and iteritems() and
so forth. [...]

As far as I know, all you have to implement yourself, to support the
dict-like interface, are:

- __getitem__
- __setitem__
- __delitem__
- __iter__
- __len__

MutableMapping can implement the rest. This wouldn't change with the
re-addition of the iter* methods.

You really have to use MutableMapping now that keys/items/values are
complicated objects: it's much harder to implement dict-like objects
from scratch in 3.x than 2.x.

Fair point.

Thank you,
Cameron Simpson <c...@zip.com.au>

Draw little boxes with arrows.  It helps.       - Michael J. Eager
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to