(a, b)
return subs_rl
Replace expressions exactly
Replace expressions exactly
Replace expressions exactly
def subs(a, b):
    """ Replace expressions exactly """
    def subs_rl(expr):
        if expr == a:
            return b
        else:
            return expr
    return subs_rl
def subs ( a , b ) : def subs_rl ( expr ) : if expr == a : return b else : return expr return subs_rl