dict.popitem(key) ???

John Machin sjmachin at lexicon.net
Sun Mar 16 00:54:20 EST 2003


"Justin Shaw" <wyojustin at hotmail.com> wrote in message news:<j_ucnfM2bJwucO6jXTWcoA at comcast.com>...
> Why doesn't popitem take a key argument that defaults to None? 

Perhaps because it wasn't designed to do what you want and/or because
None is a valid key.

> Or how
> should I pop a particular item out of a dict?

v = d[k]
del d[k]




More information about the Python-list mailing list