[Python-Dev] string.find() again (was Re: timsort for jython)
Guido van Rossum
Mon, 05 Aug 2002 15:16:18 -0400
> In testing this patch, I ran across this:
> >>> 's' in 's'
> >>> 's' in 's' == True
> >>> 's' in 's' is True
> >>> id('s' in 's')
> >>> id(True)
> What's up with that? Am I missing something?
Yes, 'is' and'in' and '==' are all comparison operators, and the
chaining syntax makes this interpreted as (roughly)
('s' in 's') and ('s' == True)
('s' in 's') and ('s' is True)
--Guido van Rossum (home page: http://www.python.org/~guido/)