Lawrence D'Oliveiro <[EMAIL PROTECTED]> writes:

> In message <[EMAIL PROTECTED]>,
> Jason wrote:
> 
> > The reason why the exception is more Pythonic is that the return
> > value is always a guaranteed good index into the list.
> 
> How do you explain dict.get, then?

I explain it by noting that list.index and dict.get serve totally
different purposes. The former returns the index given a value; the
latter returns a value given a key.

There are many areas of poor symmetry in the language and libraries;
it isn't particularly clever or difficult to find them if one
looks. Doing so doesn't appear to illustrate any point I see relevant
in this thread.

-- 
 \     "If you're a horse, and someone gets on you, and falls off, and |
  `\      then gets right back on you, I think you should buck him off |
_o__)                                     right away."  -- Jack Handey |
Ben Finney
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to