popkey() method for dictionaries?
Fernando Pérez
fperez528 at yahoo.com
Sun Nov 17 14:43:08 EST 2002
Janto Dreijer wrote:
> http://python.org/dev/doc/devel/whatsnew/node12.html
> Is this what you're looking for?
>
> I love that time machine :-)
Nice :) It's almost what I suggested, but lacks the -optional- argument for a
default value. This really seems like an oversight to me, and it violates the
principle of least surprise: d.get() has an optional default, but d.pop()
does not? They are functionally almost identical, except that pop() does a
delete afterwards. Why do these two methods have non-uniform interfaces??
I'd like to hear from one of the powers-that-be on this one. Or should a SF
bug be filed against it?
Cheers,
f.
More information about the Python-list
mailing list