brennerm/PyTricks

compoundboolstatement.py - Line 6

Closed this issue · 3 comments

https://github.com/brennerm/PyTricks/blame/master/compoundboolstatement.py#L6
Absolutely would not work.
Replace with if 1 and 6 and not 4 in l: to see that the answer is still true.
Python will check only if not 4 in l, as "1 and 6" is True.

How will you solve of this problem?
for 1 in l and 2 in l and 3 in l?
Or transform them into sets and use make intersection?

You can use: if all(map(l.__contains__, (1, 2, 3))):, but I find it as an extremely bad practice.

@yammesicka
You're right.
Shame on me ;)