-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
API: Allow comparisons with and between any python integers #24915
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
af55348
4df2840
b483533
d110554
8a0ba73
df219d0
cdbea5e
7c70ad2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -221,12 +221,6 @@ validate_spec(PyArrayMethod_Spec *spec) | |
"(method: %s)", spec->dtypes[i], spec->name); | ||
return -1; | ||
} | ||
if (NPY_DT_is_abstract(spec->dtypes[i])) { | ||
PyErr_Format(PyExc_TypeError, | ||
"abstract DType %S are currently not supported." | ||
"(method: %s)", spec->dtypes[i], spec->name); | ||
return -1; | ||
} | ||
} | ||
return 0; | ||
} | ||
|
@@ -261,6 +255,16 @@ fill_arraymethod_from_slots( | |
*/ | ||
for (PyType_Slot *slot = &spec->slots[0]; slot->slot != 0; slot++) { | ||
switch (slot->slot) { | ||
case _NPY_METH_resolve_descriptors_with_scalars: | ||
if (!private) { | ||
PyErr_SetString(PyExc_RuntimeError, | ||
"the _NPY_METH_resolve_descriptors_with_scalars " | ||
"slot private due to uncertainty about the best " | ||
"signature (see gh-24915)"); | ||
return -1; | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm fine with coming back to this when someone has a real need for it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here, fine to come back to this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not adding, I can't see a comment that does more than repeat the error message. Added a leading underscore to the slot ID, though, so it is less awkward to keep it in a public header. |
||
meth->resolve_descriptors_with_scalars = slot->pfunc; | ||
continue; | ||
case NPY_METH_resolve_descriptors: | ||
meth->resolve_descriptors = slot->pfunc; | ||
continue; | ||
|
@@ -272,7 +276,6 @@ fill_arraymethod_from_slots( | |
* (as in: we should not worry about changing it, but of | ||
* course that would not break it immediately.) | ||
*/ | ||
/* Only allow override for private functions initially */ | ||
meth->get_strided_loop = slot->pfunc; | ||
continue; | ||
/* "Typical" loops, supported used by the default `get_loop` */ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be good to add a comment here that this one is private for now given uncertainties about the signature.