'<char> in <string>' works, why doesnt '<string> in <string>'?

Justin Sheehy justin at iago.org
Mon Mar 11 11:03:47 EST 2002


morton at dennisinter.com (damien  morton) writes:

> Strings are like sequences in that their individual elements
> (characters ONLY) can be accessed as a sequence, but there are
> important differences in the kinds of things people want to do with
> strings.

Strings are not like sequences, strings are sequences.

> I think the verb IN means something slightly different for strings
> than it does for sequences and dicts.

Again, since strings are sequences, the operator "in" does not mean
something different for strings than it does for sequences.  It
cannot, since that sentence is not meaningful.

You may think that about a verb, but the issue at hand is an operator.

As readable as Python is, it does  not (and should not) strive to read
just like English or any other language except perhaps Dutch.

-Justin

 





More information about the Python-list mailing list