[Python-Dev] Re: [Python-checkins] python/dist/src/Modulesheapqmodule.c, 1.1, 1.2

Raymond Hettinger python at rcn.com
Sat Nov 15 14:02:01 EST 2003

> I thought the point of the current interface was
> that
> we could use containers other than lists as long as they defined pop
> append methods.

It would need __len__(), __getitem__(), __setitem__(), append(), and
pop().  Right now, any list of subclass of list will do.  That helps the
current implementation run faster.

I think polymorphism is more important for the contents of the container
rather than the container itself.  The objects inside the container need
only define __le__().


More information about the Python-Dev mailing list