(func, arg, retval=None)
return __sympifyit_wrapper
decorator to _sympify `arg` argument for function `func`

       don't use directly -- use _sympifyit instead
decorator to _sympify `arg` argument for function `func`
decorator to _sympify arg argument for function func
def __sympifyit(func, arg, retval=None):
    """decorator to _sympify `arg` argument for function `func`

       don't use directly -- use _sympifyit instead
    """

    # we support f(a,b) only
    if not get_function_code(func).co_argcount:
        raise LookupError("func not found")
    # only b is _sympified
    assert get_function_code(func).co_varnames[1] == arg
    if retval is None:
        @wraps(func)
        def __sympifyit_wrapper(a, b):
            return func(a, sympify(b, strict=True))

    else:
        @wraps(func)
        def __sympifyit_wrapper(a, b):
            try:
                # If an external class has _op_priority, it knows how to deal
                # with sympy objects. Otherwise, it must be converted.
                if not hasattr(b, '_op_priority'):
                    b = sympify(b, strict=True)
                return func(a, b)
            except SympifyError:
                return retval

    return __sympifyit_wrapper
def __sympifyit ( func , arg , retval = None ) : # we support f(a,b) only if not get_function_code ( func ) . co_argcount : raise LookupError ( "func not found" ) # only b is _sympified assert get_function_code ( func ) . co_varnames [ 1 ] == arg if retval is None : @ wraps ( func ) def __sympifyit_wrapper ( a , b ) : return func ( a , sympify ( b , strict = True ) ) else : @ wraps ( func ) def __sympifyit_wrapper ( a , b ) : try : # If an external class has _op_priority, it knows how to deal # with sympy objects. Otherwise, it must be converted. if not hasattr ( b , '_op_priority' ) : b = sympify ( b , strict = True ) return func ( a , b ) except SympifyError : return retval return __sympifyit_wrapper