no, this is different; it’s not for booleans, but for assertions, and could be used for e.g. exhaustive switches, e.g. it would make the first test in the following unnecessary:
if spam not in {"a", "b", "c"}:
throw new ValueError("spam {} should be a, b, or c!".format(spam))
if spam == "a":
foo()
elif spam == "b":
bar()
else:
baz()
i’m not saing i support the idea though. i’d rather see scala-like extensible pattern matching. that would solve this, the eternal switch debate, and more (using extractors).
is there a proposal for pattern matching? if not, i’ll come up with one ;)