@@ -246,7 +246,7 @@ index af9e2df..042d854 100644
246
246
acc += lane * _NpyHASH_XXPRIME_2;
247
247
acc = _NpyHASH_XXROTATE(acc);
248
248
diff --git a/numpy/core/src/common/ufunc_override.c b/numpy/core/src/common/ufunc_override.c
249
- index 4fb4d4b..a721a60 100644
249
+ index 4fb4d4b..571aae5 100644
250
250
--- a/numpy/core/src/common/ufunc_override.c
251
251
+++ b/numpy/core/src/common/ufunc_override.c
252
252
@@ -79,13 +79,12 @@ PyUFunc_HasOverride(PyObject * obj)
@@ -403,162 +403,28 @@ index af53d78..f42c8fc 100644
403
403
return NULL;
404
404
}
405
405
diff --git a/numpy/core/src/multiarray/compiled_base.c b/numpy/core/src/multiarray/compiled_base.c
406
- index 5853e06..fc7aedd 100644
406
+ index 66e79b0..8a3076a 100644
407
407
--- a/numpy/core/src/multiarray/compiled_base.c
408
408
+++ b/numpy/core/src/multiarray/compiled_base.c
409
- @@ -1414,78 +1414,78 @@ arr_add_docstring(PyObject *NPY_UNUSED(dummy), PyObject *args)
409
+ @@ -1414,6 +1414,7 @@ arr_add_docstring(PyObject *NPY_UNUSED(dummy), PyObject *args)
410
410
return NULL;
411
411
}
412
412
413
- - #define _ADDDOC(doc, name) \
414
- - if (!(doc)) { \
415
- - doc = docstr; \
416
- - Py_INCREF(str); /* hold on to string (leaks reference) */ \
417
- - } \
418
- - else if (strcmp(doc, docstr) != 0) { \
419
- - PyErr_Format(PyExc_RuntimeError, "%s method %s", name, msg); \
420
- - return NULL; \
421
- - }
422
- -
423
- - if (Py_TYPE(obj) == &PyCFunction_Type) {
424
- - PyCFunctionObject *new = (PyCFunctionObject *)obj;
425
- - _ADDDOC(PyObject_GetDoc((PyObject*)(new)), new->m_ml->ml_name);
426
- - }
427
- - else if (PyObject_TypeCheck(obj, &PyType_Type)) {
428
- - /*
429
- - * We add it to both `tp_doc` and `__doc__` here. Note that in theory
430
- - * `tp_doc` extracts the signature line, but we currently do not use
431
- - * it. It may make sense to only add it as `__doc__` and
432
- - * `__text_signature__` to the dict in the future.
433
- - * The dictionary path is only necessary for heaptypes (currently not
434
- - * used) and metaclasses.
435
- - * If `__doc__` as stored in `tp_dict` is None, we assume this was
436
- - * filled in by `PyType_Ready()` and should also be replaced.
437
- - */
438
- - PyTypeObject *new = (PyTypeObject *)obj;
439
- - _ADDDOC(new->tp_doc, new->tp_name);
440
- - if (new->tp_dict != NULL && PyDict_CheckExact(new->tp_dict) &&
441
- - PyDict_GetItemString(new->tp_dict, "__doc__") == Py_None) {
442
- - /* Warning: Modifying `tp_dict` is not generally safe! */
443
- - if (PyDict_SetItemString(new->tp_dict, "__doc__", str) < 0) {
444
- - return NULL;
445
- - }
446
- - }
447
- - }
448
- - else if (Py_TYPE(obj) == &PyMemberDescr_Type) {
449
- - PyMemberDescrObject *new = (PyMemberDescrObject *)obj;
450
- - _ADDDOC(new->d_member->doc, new->d_member->name);
451
- - }
452
- - else if (Py_TYPE(obj) == &PyGetSetDescr_Type) {
453
- - PyGetSetDescrObject *new = (PyGetSetDescrObject *)obj;
454
- - _ADDDOC(new->d_getset->doc, new->d_getset->name);
455
- - }
456
- - else if (Py_TYPE(obj) == &PyMethodDescr_Type) {
457
- - PyMethodDescrObject *new = (PyMethodDescrObject *)obj;
458
- - _ADDDOC(new->d_method->ml_doc, new->d_method->ml_name);
459
- - }
460
- - else {
461
- - PyObject *doc_attr;
462
- -
463
- - doc_attr = PyObject_GetAttrString(obj, "__doc__");
464
- - if (doc_attr != NULL && doc_attr != Py_None &&
465
- - (PyUnicode_Compare(doc_attr, str) != 0)) {
466
- - Py_DECREF(doc_attr);
467
- - if (PyErr_Occurred()) {
468
- - /* error during PyUnicode_Compare */
469
- - return NULL;
470
- - }
471
- - PyErr_Format(PyExc_RuntimeError, "object %s", msg);
472
- - return NULL;
473
- - }
474
- - Py_XDECREF(doc_attr);
475
- -
476
- - if (PyObject_SetAttrString(obj, "__doc__", str) < 0) {
477
- - PyErr_SetString(PyExc_TypeError,
478
- - "Cannot set a docstring for that object");
479
- - return NULL;
480
- - }
481
- - Py_RETURN_NONE;
482
- - }
483
- -
484
- - #undef _ADDDOC
485
- + // #define _ADDDOC(doc, name) \
486
- + // if (!(doc)) { \
487
- + // doc = docstr; \
488
- + // Py_INCREF(str); /* hold on to string (leaks reference) */ \
489
- + // } \
490
- + // else if (strcmp(doc, docstr) != 0) { \
491
- + // PyErr_Format(PyExc_RuntimeError, "%s method %s", name, msg); \
492
- + // return NULL; \
493
- + // }
494
- +
495
- + // if (Py_TYPE(obj) == &PyCFunction_Type) {
496
- + // PyCFunctionObject *new = (PyCFunctionObject *)obj;
497
- + // _ADDDOC(PyObject_GetDoc((PyObject*)(new)), new->m_ml->ml_name);
498
- + // }
499
- + // else if (PyObject_TypeCheck(obj, &PyType_Type)) {
500
- + // /*
501
- + // * We add it to both `tp_doc` and `__doc__` here. Note that in theory
502
- + // * `tp_doc` extracts the signature line, but we currently do not use
503
- + // * it. It may make sense to only add it as `__doc__` and
504
- + // * `__text_signature__` to the dict in the future.
505
- + // * The dictionary path is only necessary for heaptypes (currently not
506
- + // * used) and metaclasses.
507
- + // * If `__doc__` as stored in `tp_dict` is None, we assume this was
508
- + // * filled in by `PyType_Ready()` and should also be replaced.
509
- + // */
510
- + // PyTypeObject *new = (PyTypeObject *)obj;
511
- + // _ADDDOC(new->tp_doc, new->tp_name);
512
- + // if (new->tp_dict != NULL && PyDict_CheckExact(new->tp_dict) &&
513
- + // PyDict_GetItemString(new->tp_dict, "__doc__") == Py_None) {
514
- + // /* Warning: Modifying `tp_dict` is not generally safe! */
515
- + // if (PyDict_SetItemString(new->tp_dict, "__doc__", str) < 0) {
516
- + // return NULL;
517
- + // }
518
- + // }
519
- + // }
520
- + // else if (Py_TYPE(obj) == &PyMemberDescr_Type) {
521
- + // PyMemberDescrObject *new = (PyMemberDescrObject *)obj;
522
- + // _ADDDOC(new->d_member->doc, new->d_member->name);
523
- + // }
524
- + // else if (Py_TYPE(obj) == &PyGetSetDescr_Type) {
525
- + // PyGetSetDescrObject *new = (PyGetSetDescrObject *)obj;
526
- + // _ADDDOC(new->d_getset->doc, new->d_getset->name);
527
- + // }
528
- + // else if (Py_TYPE(obj) == &PyMethodDescr_Type) {
529
- + // PyMethodDescrObject *new = (PyMethodDescrObject *)obj;
530
- + // _ADDDOC(new->d_method->ml_doc, new->d_method->ml_name);
531
- + // }
532
- + // else {
533
- + // PyObject *doc_attr;
534
- +
535
- + // doc_attr = PyObject_GetAttrString(obj, "__doc__");
536
- + // if (doc_attr != NULL && doc_attr != Py_None &&
537
- + // (PyUnicode_Compare(doc_attr, str) != 0)) {
538
- + // Py_DECREF(doc_attr);
539
- + // if (PyErr_Occurred()) {
540
- + // /* error during PyUnicode_Compare */
541
- + // return NULL;
542
- + // }
543
- + // PyErr_Format(PyExc_RuntimeError, "object %s", msg);
544
- + // return NULL;
545
- + // }
546
- + // Py_XDECREF(doc_attr);
547
- +
548
- + // if (PyObject_SetAttrString(obj, "__doc__", str) < 0) {
549
- + // PyErr_SetString(PyExc_TypeError,
550
- + // "Cannot set a docstring for that object");
551
- + // return NULL;
552
- + // }
553
- + // Py_RETURN_NONE;
554
- + // }
555
- +
556
- + // #undef _ADDDOC
413
+ + #if 0 // GraalPy change
414
+ #define _ADDDOC(doc, name) \
415
+ if (!(doc)) { \
416
+ doc = docstr; \
417
+ @@ -1486,7 +1487,7 @@ arr_add_docstring(PyObject *NPY_UNUSED(dummy), PyObject *args)
418
+ }
557
419
420
+ #undef _ADDDOC
421
+ -
422
+ + #endif // GraalPy change
558
423
Py_RETURN_NONE;
559
424
}
425
+
560
426
diff --git a/numpy/core/src/multiarray/iterators.c b/numpy/core/src/multiarray/iterators.c
561
- index f959162..2ef579b 100644
427
+ index f959162..daf83f1 100644
562
428
--- a/numpy/core/src/multiarray/iterators.c
563
429
+++ b/numpy/core/src/multiarray/iterators.c
564
430
@@ -1400,7 +1400,11 @@ arraymultiter_new(PyTypeObject *NPY_UNUSED(subtype), PyObject *args,
@@ -575,7 +441,7 @@ index f959162..2ef579b 100644
575
441
return ret;
576
442
}
577
443
diff --git a/numpy/core/src/multiarray/methods.c b/numpy/core/src/multiarray/methods.c
578
- index 3e8c78d..60eacfb 100644
444
+ index 28fe643..46f540b 100644
579
445
--- a/numpy/core/src/multiarray/methods.c
580
446
+++ b/numpy/core/src/multiarray/methods.c
581
447
@@ -1095,7 +1095,6 @@ any_array_ufunc_overrides(PyObject *args, PyObject *kwds)
0 commit comments