keyword 'in' not returning a bool?

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


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

>>>> '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