Skip to content

Commit 019ae02

Browse files
committed
MNT: respond to minor comments from marten
1 parent a39ed17 commit 019ae02

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

numpy/_core/src/multiarray/stringdtype/dtype.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ _eq_comparison(int scoerce, int ocoerce, PyObject *sna, PyObject *ona)
185185
return na_eq_cmp(sna, ona);
186186
}
187187

188-
// Currently this can only return 1 or -1, the latter indicating that the
188+
// Currently this can only return 0 or -1, the latter indicating that the
189189
// error indicator is set. Pass in out_na if you want to figure out which
190190
// na is valid.
191191
NPY_NO_EXPORT int
@@ -206,7 +206,7 @@ stringdtype_compatible_na(PyObject *na1, PyObject *na2, PyObject **out_na) {
206206
if (out_na != NULL) {
207207
*out_na = na1 ? na1 : na2;
208208
}
209-
return 1;
209+
return 0;
210210
}
211211

212212
/*

numpy/_core/tests/test_stringdtype.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1340,8 +1340,9 @@ def test_unset_na_coercion():
13401340
# a dtype instance with an unset na object is compatible
13411341
# with a dtype that has one set
13421342

1343-
# this tests uses the "add" ufunc but all ufuncs that accept more
1344-
# than one string argument and produce a string should behave this way
1343+
# this test uses the "add" and "equal" ufunc but all ufuncs that
1344+
# accept more than one string argument and produce a string should
1345+
# behave this way
13451346
# TODO: generalize to more ufuncs
13461347
inp = ["hello", "world"]
13471348
arr = np.array(inp, dtype=StringDType(na_object=None))

0 commit comments

Comments
 (0)