On Sat, 27 Aug 2005 13:01:02 +0200, Just van Rossum <[EMAIL PROTECTED]> wrote:
> Just because you don't read the documentation and guessed wrong d.get() > needs to be removed?!? no, not removed... never said that. > It's a *feature* of d.get(k) to never raise KeyError. If you need an > exception, why not just use d[k]? i agree i misread the specs, but then, i read the specs a lot, and i guess everyone here agrees that if it's in the specs doesn't mean it's automatically what we want or expect -- else there's nothing to discuss. i say d.get('x') == None <== { ( 'x' not in d ) OR ( d['x'] == None ) } is not what i expect (even tho the specs say so) especially since d.pop('x') *does* throw a KeyError when 'x' is not a key in mydict. ok, pop is not get and so on but still i perceive this a problematic behavior (to the point i call it a 'bug' in a jocular way, no offense implied). the reason of being for d.get() -- to me -- is simply so you get a chance to pass a default value, which is syntactically well-nigh impossible with d['x']. _wolf _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com