osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Odd truth result with in and ==


21.11.18 22:17, Cameron Simpson ????:
> Can someone show me a real world, or failing that - sane looking, 
> chained comparison using "in"?

     s[0] == s[-1] in '\'"'

Tests that string s starts and ends with a single or double quote.

It can be also used with sets:

     elem in set1 <= set2