Cython seems to use except *
for fused functions rather than the more sensible except -1?
(or similar) that the specialized type would imply.
cimport cython cpdef cython.numeric f(cython.numeric x): return x def test_f_double(double x): return f(x) def test_f_int(int x): return f(x)
The generated C code is:
__pyx_t_1 = __pyx_fuse_4__pyx_f_13fused_rettype_f(__pyx_v_x, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 7, __pyx_L1_error)
and
__pyx_t_1 = __pyx_fuse_1__pyx_f_13fused_rettype_f(__pyx_v_x, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 10, __pyx_L1_error)
i.e. it misses the cheap if (__pyx_t_1 == -1)
call that it should be inserting.
The fused functions should pick up the default error return value of their specializations.
OSLinux
Python version3.11
Cython version3.0.0
Additional contextRelated to #5564 - that issue specifically involves Scipy fused functions that are a lot more costly in a nogil
block than they should be because of this (but that issue is mainly about a deadlock).
I'd like to get this into 3.0.1 if possible.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4