Commit 0c1b5aa8 authored by Stefan Behnel's avatar Stefan Behnel

new test for 'is None' in Python bool expression

parent 9c84b9d6
__doc__ = """
>>> test_and(None, None)
True
>>> test_and(None, 1)
False
>>> test_and(1, None)
False
>>> test_more(None, None)
True
>>> test_more(None, 1)
True
>>> test_more(1, None)
False
>>> test_more(None, 0)
False
"""
def test_and(a,b):
return a is None and b is None
def test_more(a,b):
return a is None and (b is None or b == 1)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment