namespace issue?

Donn Cave donn at u.washington.edu
Thu Jun 21 18:23:32 EDT 2001


Quoth Michael Powe <looie+gnus at aracnet.com>:
...
| So now the question is, 'why'?  Am I misusing the string.find()
| function? Okay, string.find() returns -1 when the string is not found,
| which would seem to be what I expected, a false result.  Maybe python
| doesn't treat -1 as false?  Well, I'll try being explicit and testing
| for -1 return.  I probably have just confused myself hopelessly.
|
| Thanks for the ... clue.  I saw a great line in an email today  -- "Is
| that the clue phone ringing?  I think it's for you."  And I think I'll
| go answer it.

You heard the phone ring, picked it up, and heard "Maybe python
doesn't treat -1 as false?"  It might be worth your trouble to
check that out.  There are a number of different values that test
false in Python, and though different they tend to have something
in common.  -1 doesn't fit the pattern.

	Donn Cave, donn at u.washington.edu



More information about the Python-list mailing list