keyword 'in' not returning a bool?

Richard Brodie R.Brodie at
Fri Feb 8 18:21:54 CET 2008

"c james" <cjames at> wrote in message 
news:mailman.521.1202490602.9267.python-list at

>>>> 't' in sample == True
> False

It's comparison operator chaining:

't' in sample == True is like 't' == sample == True

and is equivalent to  't' in sample and sample == True 

More information about the Python-list mailing list