Hi,
the Get/SetItemInt helper macros usually look something like this:
"""
#define __Pyx_GetItemInt(o, i, size, to_py_func, is_list, wraparound,
boundscheck) \
(((size) <= sizeof(Py_ssize_t)) ? \
__Pyx_GetItemInt_Fast(o, i, is_list, wraparound, boundscheck) : \
__Pyx_GetItemInt_Generi
Having thought about this come more:
Stefan Behnel, 08.11.2013 15:16:
> the Get/SetItemInt helper macros usually look something like this:
>
> """
> #define __Pyx_GetItemInt(o, i, size, to_py_func, is_list, wraparound,
> boundscheck) \
> (((size) <= sizeof(Py_ssize_t)) ? \
I noticed that the
Stefan Behnel, 09.11.2013 07:17:
> Putting it all together, we can use the fast path in these cases:
>
> (sizeof(type_of_i) < sizeof(Py_ssize_t)) ||
>
> (sizeof(type_of_i) > sizeof(Py_ssize_t) &&
> (i <= (type_of_i)PY_SSIZE_T_MAX) &&
> (!signed || i >= (type_of_i)PY_