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 也能正確運作。