[Python-3000] UserDict revamp

Eduardo "EdCrypt" O. Padoan eopadoan at altavix.com
Thu Feb 15 13:24:42 CET 2007

Ops, sending to the whole list.

On 2/15/07, Guido van Rossum <guido at python.org> wrote:
> I tried to fix a few more unit tests tonight that had started failing
> after the introduction of dict views. Looking over UserDict.py, it's
> clear that this module needs more work -- while I banged it into
> submission with minimal effort, it would reallly make a lot more sense
> to redesign UserDict and MixinDict so they are more like dict, even if
> this means that their users will have to be fixed, too.
> Perhaps the most egregious example is MixinDict, which currently
> assumes that keys() is a primitive operation returning a list, and
> builds __iter__() out of that. Obviously a better approach is to turn
> this around. (I'd have thought that ever since 2.2 this would have
> been the better design, but perhaps it was too late then already.)

s/MixinDict/DictMixin ? :)

> Is someone interested in looking at a redesign and cleanup of these
> classes? I suppose that they also need a Python implementation of
> dictionary views -- some of this can be lifted straight out of PEP
> 3106, fortunately.

I would love to spend my weekend looking into this. I already read the
PEP 3106 and I think I understand it.
It is carnival, and I'm no fan of samba music.

EduardoOPadoan (eopadoan->altavix::com)
Bookmarks: http://del.icio.us/edcrypt

More information about the Python-3000 mailing list