[Python-Dev] Dafanging the find() gotcha
Mon, 5 Aug 2002 18:49:03 -0400
On Mon, Aug 05, 2002, Andrew Koenig wrote:
> I'm not trying to be flip here -- I'm trying to make the point that in
> my opinion, having a uniform rule is preferable to catching particular
> cases that are sometimes mistakes.
It's not so much that '' in 'abc' is a mistake as that there's no
sensible answer to be given. When Python can't figure out how to
deliver a sensible answer, it raises an exception: "In the face of
ambiguity, refuse the temptation to guess."
Aahz (email@example.com) <*> http://www.pythoncraft.com/
Project Vote Smart: http://www.vote-smart.org/