pop method question

MonkeeSage MonkeeSage at gmail.com
Sun Mar 4 04:40:29 CET 2007


Nick,

In regards to stack-like objects, pop() implies mutation of the
reciever and returning the item 'popped' off the stack. The same
_semantic_ meaning can be used for pop() regarding dictionaries, even
though the _implementation_ would be different: dict.pop(key) mutates
the reciever and returns the value associated with the key.

Regards,
Jordan




More information about the Python-list mailing list