We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 99412fd commit 4b5aa6bCopy full SHA for 4b5aa6b
lib/matplotlib/cbook.py
@@ -411,7 +411,19 @@ def allpairs(x):
411
assert( not allequal(('a', 'b')))
412
413
414
+# python 2.2 dicts don't have pop
415
def popd(d, *args):
416
+ """
417
+ Should behave like python2.3 pop method; d is a dict
418
+
419
+ # returns value for key and deletes item; raises a KeyError if key
420
+ # is not in dict
421
+ val = popd(d, key)
422
423
+ # returns value for key if key exists, else default. Delete key,
424
+ # val item if it exists. Will not raise a KeyError
425
+ val = popd(d, key, default)
426
427
if len(args)==1:
428
key = args[0]
429
val = d[key]
0 commit comments