@@ -1040,14 +1040,16 @@ def make_ufuncs(funcdict):
1040
1040
# string literal in C code. We split at endlines because textwrap.wrap
1041
1041
# do not play well with \n
1042
1042
docstring = '\\ n\" \" ' .join (docstring .split (r"\n" ))
1043
- mlist .append (textwrap .dedent ("""\
1044
- f = PyUFunc_FromFuncAndData(%s_functions, %s_data, %s_signatures, %d,
1045
- %d, %d, %s, "%s",
1046
- "%s", 0);""" ) % (name , name , name ,
1047
- len (uf .type_descriptions ),
1048
- uf .nin , uf .nout ,
1049
- uf .identity ,
1050
- name , docstring ))
1043
+ fmt = textwrap .dedent ("""\
1044
+ f = PyUFunc_FromFuncAndData(
1045
+ {name}_functions, {name}_data, {name}_signatures, {nloops},
1046
+ {nin}, {nout}, {identity}, "{name}",
1047
+ "{doc}", 0
1048
+ );""" )
1049
+ mlist .append (fmt .format (
1050
+ name = name , nloops = len (uf .type_descriptions ),
1051
+ nin = uf .nin , nout = uf .nout , identity = uf .identity , doc = docstring
1052
+ ))
1051
1053
if uf .typereso is not None :
1052
1054
mlist .append (
1053
1055
r"((PyUFuncObject *)f)->type_resolver = &%s;" % uf .typereso )
0 commit comments