def fallback(cond, backup):
    'Decorator for returning the object if cond is true and a backup if\n    cond is false. '

    def dec(obj):
        return (obj if cond else backup)
    return dec
Decorator for returning the object if cond is true and a backup if
cond is false.
def fallback(cond, backup):
    'Decorator for returning the object if cond is true and a backup if\n    cond is false. '

    def dec(obj):
        return (obj if cond else backup)
    return dec