def when(b, x):
    """
    Like Python's `if` in comprehensions.

    Named for Clojure's :when keyword, which has the same function in
    its comprehensions.

    >>> list(x+y for x in 'zazbzcz' if x!='z' for y in 'abc' if x!=y)
    ['ab', 'ac', 'ba', 'bc', 'ca', 'cb']
    >>> list(In('zazbzcz', lambda x:
    ...     when(x!='z', In('abc', lambda y:
    ...        when(x!=y, (x+y,) )))))
    ['ab', 'ac', 'ba', 'bc', 'ca', 'cb']
    """
    return x if b else ()