[Patches] In overloading: not special casing strings
Skip Montanaro
skip@mojam.com (Skip Montanaro)
Wed, 8 Mar 2000 09:30:32 -0600 (CST)
Guido> Same with non-length-1 character strings. A newbie could easily
Guido> believe that "bc" in "abcd" should return 1 -- rather than having
Guido> them puzzle why it doesn't work (they probably tried ("xyz" in
Guido> "abc") first and found that it correctly returned 0 :-), I give
Guido> them an error explaining that it doesn't work that way.
Yes, please keep this behavior. I encounter it on occasion, most frequently
in a context where both sides of the "in" operator are variables and I've
somehow screwed up when generating the left operand so that its length is >
1 or screwed up generating the right operand as a string when it should have
been a list. Silently returning zero would allow a relatively common (for
me) bug to go unannounced.
Skip Montanaro | http://www.mojam.com/
skip@mojam.com | http://www.musi-cal.com/