@@ -65,7 +65,7 @@ promote_and_get_info_and_ufuncimpl(PyUFuncObject *ufunc,
65
65
PyArrayObject * const ops [],
66
66
PyArray_DTypeMeta * signature [],
67
67
PyArray_DTypeMeta * op_dtypes [],
68
- npy_bool allow_legacy_promotion );
68
+ npy_bool legacy_promotion_is_possible );
69
69
70
70
71
71
/**
@@ -760,7 +760,7 @@ promote_and_get_info_and_ufuncimpl(PyUFuncObject *ufunc,
760
760
PyArrayObject * const ops [],
761
761
PyArray_DTypeMeta * signature [],
762
762
PyArray_DTypeMeta * op_dtypes [],
763
- npy_bool allow_legacy_promotion )
763
+ npy_bool legacy_promotion_is_possible )
764
764
{
765
765
/*
766
766
* Fetch the dispatching info which consists of the implementation and
@@ -829,7 +829,7 @@ promote_and_get_info_and_ufuncimpl(PyUFuncObject *ufunc,
829
829
* However, we need to give the legacy implementation a chance here.
830
830
* (it will modify `op_dtypes`).
831
831
*/
832
- if (!allow_legacy_promotion || ufunc -> type_resolver == NULL ||
832
+ if (!legacy_promotion_is_possible || ufunc -> type_resolver == NULL ||
833
833
(ufunc -> ntypes == 0 && ufunc -> userloops == NULL )) {
834
834
/* Already tried or not a "legacy" ufunc (no loop found, return) */
835
835
return NULL ;
@@ -940,7 +940,7 @@ promote_and_get_ufuncimpl(PyUFuncObject *ufunc,
940
940
npy_bool ensure_reduce_compatible )
941
941
{
942
942
int nin = ufunc -> nin , nargs = ufunc -> nargs ;
943
- npy_bool allow_legacy_promotion = NPY_TRUE ;
943
+ npy_bool legacy_promotion_is_possible = NPY_TRUE ;
944
944
945
945
/*
946
946
* Get the actual DTypes we operate with by setting op_dtypes[i] from
@@ -972,13 +972,13 @@ promote_and_get_ufuncimpl(PyUFuncObject *ufunc,
972
972
if (op_dtypes [i ] != NULL && !NPY_DT_is_legacy (op_dtypes [i ]) && (
973
973
signature [i ] != NULL || // signature cannot be a pyscalar
974
974
!(PyArray_FLAGS (ops [i ]) & NPY_ARRAY_WAS_PYTHON_LITERAL ))) {
975
- allow_legacy_promotion = NPY_FALSE ;
975
+ legacy_promotion_is_possible = NPY_FALSE ;
976
976
}
977
977
}
978
978
979
979
int current_promotion_state = get_npy_promotion_state ();
980
980
981
- if (force_legacy_promotion && allow_legacy_promotion
981
+ if (force_legacy_promotion && legacy_promotion_is_possible
982
982
&& current_promotion_state == NPY_USE_LEGACY_PROMOTION
983
983
&& (ufunc -> ntypes != 0 || ufunc -> userloops != NULL )) {
984
984
/*
@@ -996,7 +996,7 @@ promote_and_get_ufuncimpl(PyUFuncObject *ufunc,
996
996
/* Pause warnings and always use "new" path */
997
997
set_npy_promotion_state (NPY_USE_WEAK_PROMOTION );
998
998
PyObject * info = promote_and_get_info_and_ufuncimpl (ufunc ,
999
- ops , signature , op_dtypes , allow_legacy_promotion );
999
+ ops , signature , op_dtypes , legacy_promotion_is_possible );
1000
1000
set_npy_promotion_state (current_promotion_state );
1001
1001
1002
1002
if (info == NULL ) {
0 commit comments