> Grab(argdict, key, default) is argdict.pop(key, default) "pop() raises a KeyError when no default value is given and the key is not found."
> def grab(kw, key, default=None): > try: > return kw.pop(key) > except KeyError: > return default So Bruno's technique seems to me to be the correct one as it catches the KeyError. -- http://mail.python.org/mailman/listinfo/python-list