FFIVE
可以看一下不一定正确,原始的sum是对两个值进行求和,而numpy.sum()此时你的-1会作为axis参数传递@array_function_dispatch(_sum_dispatcher)defsum(a,axis=None,dtype=None,out=None,keepdims=np._NoValue,initial=np._NoValue,where=np._NoValue):测试代码defhc(a,b=None,c=None):print("参数a",a)print("参数b",b)print("参数c",c)passhc(range(5),-1)输出结果参数arange(0,5)参数b-1参数cNone