[Python-Dev] {}.first[key,value,item] and {}.pop (was Re: {}.getitem())

Peter Funk pf@artcom-gmbh.de
Thu, 30 Nov 2000 12:33:30 +0100 (MET)


Guido van Rossum:
[...]
> Thinking aloud:
> 
> Would it be useful to also implement popkey(), popvalue(), popitem(),
> which would remove the first item and then return the relevant part of
> it?

Since [].pop() takes in optional index as parameter which defaults
to the *LAST* element, it would be better to make the name explicit:
.popfirstitem()

This is however some what long.  DEJAVU: the {}.setdefault() discussion.
May it is better to leave these methods out for the sake of simplicity, 
although they look useful.

Regards, Peter