"in"consistency?

Mel mwilson at the-wire.com
Tue Jul 8 21:54:30 EDT 2008


David C. Ullrich wrote:

> Oh, of course that's a good thing - changing "in" for lists
> to give True there would be awful. I was wondering why it
> _does_ work that way for strings.
> 
> Maybe the answer is "because it can" - for strings the sort
> of possible problem you point out can't come up.

I think that's it.  When people realized how handy 

    small_string in big_string

would be, they expanded the string behaviour.  Python is a pragmatic
language.

        Cheers,         Mel.




More information about the Python-list mailing list