numpy.testing.overrides.allows_array_ufunc_override#

testing.overrides.allows_array_ufunc_override(func)[源代码]#

确定是否可以通过 `__ array_ufunc__ ` 重写函数

参数:
funccallable

可以通过 __ array_ufunc__ 重写的函数

返回:
bool

如果 func ` 可以通过 `__ array_ufunc__ 重写,则为 True ;否则为 False .

注释

此函数等效于 isinstance(func, np.ufunc) ,并且对于在 Numpy 之外定义的 ufunc 可以正常工作.