"in"consistency?

Mel mwilson at the-wire.com
Wed Jul 9 03:54:30 CEST 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