You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
This'd probably apply mainly to functions with annotations dictionaries. For example
def f(a: int, b: float):
pass
generates
__pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_a, __pyx_n_s_int) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_b, __pyx_n_s_float) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
which is relatively repetitive (especially for the error handling)
Describe the solution you'd like.
It might be worth creating a __Pyx_PyDict_Pack function for slow code sections that just iterates over variadic arguments to reduce the code size here.
the dictionary generation code in Cython is already pretty complicated and accounts for lots of different cases. Adding another case looked fairly fiddly to me.
Additional context
I'm listing this as an idea. I'm on the fence if it's likely to be worth it.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
This'd probably apply mainly to functions with annotations dictionaries. For example
generates
which is relatively repetitive (especially for the error handling)
Describe the solution you'd like.
It might be worth creating a
__Pyx_PyDict_Pack
function for slow code sections that just iterates over variadic arguments to reduce the code size here.In this case:
Describe alternatives you've considered.
The main reason not to do it:
Additional context
I'm listing this as an idea. I'm on the fence if it's likely to be worth it.
The text was updated successfully, but these errors were encountered: