diff --git a/arrex/list.c b/arrex/list.c index 4366714..dc81a28 100644 --- a/arrex/list.c +++ b/arrex/list.c @@ -1,4 +1,4 @@ -/* Generated by Cython 0.29.27 */ +/* Generated by Cython 0.29.28 */ /* BEGIN: Cython Metadata { @@ -22,8 +22,8 @@ END: Cython Metadata */ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else -#define CYTHON_ABI "0_29_27" -#define CYTHON_HEX_VERSION 0x001D1BF0 +#define CYTHON_ABI "0_29_28" +#define CYTHON_HEX_VERSION 0x001D1CF0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof @@ -185,7 +185,10 @@ END: Cython Metadata */ #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif - #ifndef CYTHON_FAST_THREAD_STATE + #if PY_VERSION_HEX >= 0x030B00A4 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #elif !defined(CYTHON_FAST_THREAD_STATE) #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_PYCALL @@ -200,7 +203,10 @@ END: Cython Metadata */ #ifndef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) #endif - #ifndef CYTHON_USE_EXC_INFO_STACK + #if PY_VERSION_HEX >= 0x030B00A4 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 + #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) #endif #endif @@ -993,7 +999,7 @@ struct __pyx_obj_5arrex_4list_typedlist { }; -/* "arrex/list.pyx":645 +/* "arrex/list.pyx":666 * * * cdef class arrayexposer: # <<<<<<<<<<<<<< @@ -1007,7 +1013,7 @@ struct __pyx_obj_5arrex_4list_arrayexposer { }; -/* "arrex/list.pyx":652 +/* "arrex/list.pyx":673 * * * cdef class arrayiter: # <<<<<<<<<<<<<< @@ -1291,6 +1297,14 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObjec __Pyx__ArgTypeTest(obj, type, name, exact)) static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); +/* PyIntBinop.proto */ +#if !CYTHON_COMPILING_IN_PYPY +static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); +#else +#define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\ + (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) +#endif + /* ExtTypeTest.proto */ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); @@ -1604,8 +1618,8 @@ static PyObject *__pyx_builtin_print; static PyObject *__pyx_builtin_OverflowError; static PyObject *__pyx_builtin_enumerate; static const char __pyx_k_i[] = "i"; -static const char __pyx_k__13[] = ", "; -static const char __pyx_k__14[] = "])"; +static const char __pyx_k__12[] = ", "; +static const char __pyx_k__13[] = "])"; static const char __pyx_k_new[] = "__new__"; static const char __pyx_k_sys[] = "sys"; static const char __pyx_k_dict[] = "__dict__"; @@ -1668,7 +1682,6 @@ static const char __pyx_k_incorrect_slice[] = "incorrect slice"; static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError"; static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; static const char __pyx_k_value_not_found[] = "value not found"; -static const char __pyx_k_index_must_be_int[] = "index must be int"; static const char __pyx_k_iterable_is_empty[] = "iterable is empty"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_index_out_of_range[] = "index out of range"; @@ -1697,8 +1710,8 @@ static PyObject *__pyx_n_s_RuntimeError; static PyObject *__pyx_n_s_StopIteration; static PyObject *__pyx_n_s_TypeError; static PyObject *__pyx_n_s_ValueError; +static PyObject *__pyx_kp_u__12; static PyObject *__pyx_kp_u__13; -static PyObject *__pyx_kp_u__14; static PyObject *__pyx_kp_u_amount_must_be_positive; static PyObject *__pyx_n_s_append; static PyObject *__pyx_n_s_array; @@ -1722,7 +1735,6 @@ static PyObject *__pyx_n_s_i; static PyObject *__pyx_n_s_import; static PyObject *__pyx_kp_u_incorrect_slice; static PyObject *__pyx_n_s_index; -static PyObject *__pyx_kp_u_index_must_be_int; static PyObject *__pyx_kp_u_index_must_be_int_or_slice; static PyObject *__pyx_kp_u_index_out_of_range; static PyObject *__pyx_n_u_iter; @@ -1788,17 +1800,18 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_26shrink(struct __pyx_obj_5arr static Py_ssize_t __pyx_pf_5arrex_4list_9typedlist_28__len__(struct __pyx_obj_5arrex_4list_typedlist *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_5arrex_4list_9typedlist_30__getitem__(struct __pyx_obj_5arrex_4list_typedlist *__pyx_v_self, PyObject *__pyx_v_index); /* proto */ static int __pyx_pf_5arrex_4list_9typedlist_32__setitem__(struct __pyx_obj_5arrex_4list_typedlist *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */ -static PyObject *__pyx_pf_5arrex_4list_9typedlist_34__iter__(struct __pyx_obj_5arrex_4list_typedlist *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5arrex_4list_9typedlist_36__repr__(struct __pyx_obj_5arrex_4list_typedlist *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5arrex_4list_9typedlist_38__eq__(struct __pyx_obj_5arrex_4list_typedlist *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ -static PyObject *__pyx_pf_5arrex_4list_9typedlist_40__copy__(struct __pyx_obj_5arrex_4list_typedlist *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5arrex_4list_9typedlist_42__deepcopy__(struct __pyx_obj_5arrex_4list_typedlist *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_memo); /* proto */ -static PyObject *__pyx_pf_5arrex_4list_9typedlist_44__reduce_ex__(struct __pyx_obj_5arrex_4list_typedlist *__pyx_v_self, PyObject *__pyx_v_protocol); /* proto */ -static PyObject *__pyx_pf_5arrex_4list_9typedlist_46_rebuild(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_owner, PyObject *__pyx_v_dtype, size_t __pyx_v_start, size_t __pyx_v_size); /* proto */ -static int __pyx_pf_5arrex_4list_9typedlist_48__getbuffer__(struct __pyx_obj_5arrex_4list_typedlist *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags); /* proto */ -static void __pyx_pf_5arrex_4list_9typedlist_50__releasebuffer__(CYTHON_UNUSED struct __pyx_obj_5arrex_4list_typedlist *__pyx_v_self, Py_buffer *__pyx_v_view); /* proto */ -static PyObject *__pyx_pf_5arrex_4list_9typedlist_52reverse(struct __pyx_obj_5arrex_4list_typedlist *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5arrex_4list_9typedlist_54index(struct __pyx_obj_5arrex_4list_typedlist *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_5arrex_4list_9typedlist_34__delitem__(struct __pyx_obj_5arrex_4list_typedlist *__pyx_v_self, PyObject *__pyx_v_index); /* proto */ +static PyObject *__pyx_pf_5arrex_4list_9typedlist_36__iter__(struct __pyx_obj_5arrex_4list_typedlist *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_5arrex_4list_9typedlist_38__repr__(struct __pyx_obj_5arrex_4list_typedlist *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_5arrex_4list_9typedlist_40__eq__(struct __pyx_obj_5arrex_4list_typedlist *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ +static PyObject *__pyx_pf_5arrex_4list_9typedlist_42__copy__(struct __pyx_obj_5arrex_4list_typedlist *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_5arrex_4list_9typedlist_44__deepcopy__(struct __pyx_obj_5arrex_4list_typedlist *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_memo); /* proto */ +static PyObject *__pyx_pf_5arrex_4list_9typedlist_46__reduce_ex__(struct __pyx_obj_5arrex_4list_typedlist *__pyx_v_self, PyObject *__pyx_v_protocol); /* proto */ +static PyObject *__pyx_pf_5arrex_4list_9typedlist_48_rebuild(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_owner, PyObject *__pyx_v_dtype, size_t __pyx_v_start, size_t __pyx_v_size); /* proto */ +static int __pyx_pf_5arrex_4list_9typedlist_50__getbuffer__(struct __pyx_obj_5arrex_4list_typedlist *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags); /* proto */ +static void __pyx_pf_5arrex_4list_9typedlist_52__releasebuffer__(CYTHON_UNUSED struct __pyx_obj_5arrex_4list_typedlist *__pyx_v_self, Py_buffer *__pyx_v_view); /* proto */ +static PyObject *__pyx_pf_5arrex_4list_9typedlist_54reverse(struct __pyx_obj_5arrex_4list_typedlist *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_5arrex_4list_9typedlist_56index(struct __pyx_obj_5arrex_4list_typedlist *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_5arrex_4list_9typedlist_4size___get__(struct __pyx_obj_5arrex_4list_typedlist *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_5arrex_4list_9typedlist_9allocated___get__(struct __pyx_obj_5arrex_4list_typedlist *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_5arrex_4list_9typedlist_5owner___get__(struct __pyx_obj_5arrex_4list_typedlist *__pyx_v_self); /* proto */ @@ -1816,6 +1829,7 @@ static PyObject *__pyx_tp_new_5arrex_4list_typedlist(PyTypeObject *t, PyObject * static PyObject *__pyx_tp_new_5arrex_4list_arrayexposer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_5arrex_4list_arrayiter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_int_0; +static PyObject *__pyx_int_1; static PyObject *__pyx_int_5; static PyObject *__pyx_int_26530323; static PyObject *__pyx_int_211671663; @@ -1828,21 +1842,20 @@ static PyObject *__pyx_tuple__6; static PyObject *__pyx_tuple__7; static PyObject *__pyx_tuple__8; static PyObject *__pyx_tuple__9; -static PyObject *__pyx_slice__15; +static PyObject *__pyx_slice__14; static PyObject *__pyx_tuple__10; static PyObject *__pyx_tuple__11; -static PyObject *__pyx_tuple__12; +static PyObject *__pyx_tuple__15; static PyObject *__pyx_tuple__16; static PyObject *__pyx_tuple__17; static PyObject *__pyx_tuple__18; -static PyObject *__pyx_tuple__19; -static PyObject *__pyx_tuple__21; -static PyObject *__pyx_tuple__23; -static PyObject *__pyx_tuple__25; -static PyObject *__pyx_codeobj__20; -static PyObject *__pyx_codeobj__22; -static PyObject *__pyx_codeobj__24; -static PyObject *__pyx_codeobj__26; +static PyObject *__pyx_tuple__20; +static PyObject *__pyx_tuple__22; +static PyObject *__pyx_tuple__24; +static PyObject *__pyx_codeobj__19; +static PyObject *__pyx_codeobj__21; +static PyObject *__pyx_codeobj__23; +static PyObject *__pyx_codeobj__25; /* Late includes */ /* "arrex/list.pyx":123 @@ -6143,12 +6156,12 @@ static int __pyx_pf_5arrex_4list_9typedlist_32__setitem__(struct __pyx_obj_5arre /* "arrex/list.pyx":493 * * else: - * raise IndexError('index must be int') # <<<<<<<<<<<<<< + * raise IndexError('index must be int or slice') # <<<<<<<<<<<<<< * - * def __iter__(self): + * def __delitem__(self, index): */ /*else*/ { - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 493, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -6178,7 +6191,254 @@ static int __pyx_pf_5arrex_4list_9typedlist_32__setitem__(struct __pyx_obj_5arre } /* "arrex/list.pyx":495 - * raise IndexError('index must be int') + * raise IndexError('index must be int or slice') + * + * def __delitem__(self, index): # <<<<<<<<<<<<<< + * cdef Py_ssize_t start, stop, step + * + */ + +/* Python wrapper */ +static int __pyx_pw_5arrex_4list_9typedlist_35__delitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/ +static int __pyx_pw_5arrex_4list_9typedlist_35__delitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__delitem__ (wrapper)", 0); + __pyx_r = __pyx_pf_5arrex_4list_9typedlist_34__delitem__(((struct __pyx_obj_5arrex_4list_typedlist *)__pyx_v_self), ((PyObject *)__pyx_v_index)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_5arrex_4list_9typedlist_34__delitem__(struct __pyx_obj_5arrex_4list_typedlist *__pyx_v_self, PyObject *__pyx_v_index) { + Py_ssize_t __pyx_v_start; + Py_ssize_t __pyx_v_stop; + Py_ssize_t __pyx_v_step; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__delitem__", 0); + + /* "arrex/list.pyx":498 + * cdef Py_ssize_t start, stop, step + * + * if PyNumber_Check(index): # <<<<<<<<<<<<<< + * start = index + * stop = index+1 + */ + __pyx_t_1 = (PyNumber_Check(__pyx_v_index) != 0); + if (__pyx_t_1) { + + /* "arrex/list.pyx":499 + * + * if PyNumber_Check(index): + * start = index # <<<<<<<<<<<<<< + * stop = index+1 + * elif isinstance(index, slice): + */ + __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 499, __pyx_L1_error) + __pyx_v_start = __pyx_t_2; + + /* "arrex/list.pyx":500 + * if PyNumber_Check(index): + * start = index + * stop = index+1 # <<<<<<<<<<<<<< + * elif isinstance(index, slice): + * if PySlice_Unpack(index, &start, &stop, &step): + */ + __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_index, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 500, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 500, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_stop = __pyx_t_2; + + /* "arrex/list.pyx":498 + * cdef Py_ssize_t start, stop, step + * + * if PyNumber_Check(index): # <<<<<<<<<<<<<< + * start = index + * stop = index+1 + */ + goto __pyx_L3; + } + + /* "arrex/list.pyx":501 + * start = index + * stop = index+1 + * elif isinstance(index, slice): # <<<<<<<<<<<<<< + * if PySlice_Unpack(index, &start, &stop, &step): + * raise IndexError('incorrect slice') + */ + __pyx_t_1 = PySlice_Check(__pyx_v_index); + __pyx_t_4 = (__pyx_t_1 != 0); + if (likely(__pyx_t_4)) { + + /* "arrex/list.pyx":502 + * stop = index+1 + * elif isinstance(index, slice): + * if PySlice_Unpack(index, &start, &stop, &step): # <<<<<<<<<<<<<< + * raise IndexError('incorrect slice') + * if step != 1: + */ + __pyx_t_5 = PySlice_Unpack(__pyx_v_index, (&__pyx_v_start), (&__pyx_v_stop), (&__pyx_v_step)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 502, __pyx_L1_error) + __pyx_t_4 = (__pyx_t_5 != 0); + if (unlikely(__pyx_t_4)) { + + /* "arrex/list.pyx":503 + * elif isinstance(index, slice): + * if PySlice_Unpack(index, &start, &stop, &step): + * raise IndexError('incorrect slice') # <<<<<<<<<<<<<< + * if step != 1: + * raise IndexError('slice step is not supported') + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 503, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(0, 503, __pyx_L1_error) + + /* "arrex/list.pyx":502 + * stop = index+1 + * elif isinstance(index, slice): + * if PySlice_Unpack(index, &start, &stop, &step): # <<<<<<<<<<<<<< + * raise IndexError('incorrect slice') + * if step != 1: + */ + } + + /* "arrex/list.pyx":504 + * if PySlice_Unpack(index, &start, &stop, &step): + * raise IndexError('incorrect slice') + * if step != 1: # <<<<<<<<<<<<<< + * raise IndexError('slice step is not supported') + * PySlice_AdjustIndices(self._len(), &start, &stop, step) + */ + __pyx_t_4 = ((__pyx_v_step != 1) != 0); + if (unlikely(__pyx_t_4)) { + + /* "arrex/list.pyx":505 + * raise IndexError('incorrect slice') + * if step != 1: + * raise IndexError('slice step is not supported') # <<<<<<<<<<<<<< + * PySlice_AdjustIndices(self._len(), &start, &stop, step) + * else: + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 505, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(0, 505, __pyx_L1_error) + + /* "arrex/list.pyx":504 + * if PySlice_Unpack(index, &start, &stop, &step): + * raise IndexError('incorrect slice') + * if step != 1: # <<<<<<<<<<<<<< + * raise IndexError('slice step is not supported') + * PySlice_AdjustIndices(self._len(), &start, &stop, step) + */ + } + + /* "arrex/list.pyx":506 + * if step != 1: + * raise IndexError('slice step is not supported') + * PySlice_AdjustIndices(self._len(), &start, &stop, step) # <<<<<<<<<<<<<< + * else: + * raise IndexError('index must be int or slice') + */ + (void)(PySlice_AdjustIndices(((struct __pyx_vtabstruct_5arrex_4list_typedlist *)__pyx_v_self->__pyx_vtab)->_len(__pyx_v_self), (&__pyx_v_start), (&__pyx_v_stop), __pyx_v_step)); + + /* "arrex/list.pyx":501 + * start = index + * stop = index+1 + * elif isinstance(index, slice): # <<<<<<<<<<<<<< + * if PySlice_Unpack(index, &start, &stop, &step): + * raise IndexError('incorrect slice') + */ + goto __pyx_L3; + } + + /* "arrex/list.pyx":508 + * PySlice_AdjustIndices(self._len(), &start, &stop, step) + * else: + * raise IndexError('index must be int or slice') # <<<<<<<<<<<<<< + * + * start *= self.dtype.dsize + */ + /*else*/ { + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 508, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(0, 508, __pyx_L1_error) + } + __pyx_L3:; + + /* "arrex/list.pyx":510 + * raise IndexError('index must be int or slice') + * + * start *= self.dtype.dsize # <<<<<<<<<<<<<< + * stop *= self.dtype.dsize + * memmove(self.ptr+start, self.ptr+stop, self.size-stop) + */ + __pyx_v_start = (__pyx_v_start * __pyx_v_self->dtype->dsize); + + /* "arrex/list.pyx":511 + * + * start *= self.dtype.dsize + * stop *= self.dtype.dsize # <<<<<<<<<<<<<< + * memmove(self.ptr+start, self.ptr+stop, self.size-stop) + * self.size = self.size + start - stop + */ + __pyx_v_stop = (__pyx_v_stop * __pyx_v_self->dtype->dsize); + + /* "arrex/list.pyx":512 + * start *= self.dtype.dsize + * stop *= self.dtype.dsize + * memmove(self.ptr+start, self.ptr+stop, self.size-stop) # <<<<<<<<<<<<<< + * self.size = self.size + start - stop + * + */ + (void)(memmove((__pyx_v_self->ptr + __pyx_v_start), (__pyx_v_self->ptr + __pyx_v_stop), (__pyx_v_self->size - __pyx_v_stop))); + + /* "arrex/list.pyx":513 + * stop *= self.dtype.dsize + * memmove(self.ptr+start, self.ptr+stop, self.size-stop) + * self.size = self.size + start - stop # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_self->size = ((__pyx_v_self->size + __pyx_v_start) - __pyx_v_stop); + + /* "arrex/list.pyx":495 + * raise IndexError('index must be int or slice') + * + * def __delitem__(self, index): # <<<<<<<<<<<<<< + * cdef Py_ssize_t start, stop, step + * + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("arrex.list.typedlist.__delitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "arrex/list.pyx":516 + * * * def __iter__(self): # <<<<<<<<<<<<<< * ''' yield successive elements in the list ''' @@ -6186,23 +6446,23 @@ static int __pyx_pf_5arrex_4list_9typedlist_32__setitem__(struct __pyx_obj_5arre */ /* Python wrapper */ -static PyObject *__pyx_pw_5arrex_4list_9typedlist_35__iter__(PyObject *__pyx_v_self); /*proto*/ -static char __pyx_doc_5arrex_4list_9typedlist_34__iter__[] = " yield successive elements in the list "; +static PyObject *__pyx_pw_5arrex_4list_9typedlist_37__iter__(PyObject *__pyx_v_self); /*proto*/ +static char __pyx_doc_5arrex_4list_9typedlist_36__iter__[] = " yield successive elements in the list "; #if CYTHON_COMPILING_IN_CPYTHON -struct wrapperbase __pyx_wrapperbase_5arrex_4list_9typedlist_34__iter__; +struct wrapperbase __pyx_wrapperbase_5arrex_4list_9typedlist_36__iter__; #endif -static PyObject *__pyx_pw_5arrex_4list_9typedlist_35__iter__(PyObject *__pyx_v_self) { +static PyObject *__pyx_pw_5arrex_4list_9typedlist_37__iter__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); - __pyx_r = __pyx_pf_5arrex_4list_9typedlist_34__iter__(((struct __pyx_obj_5arrex_4list_typedlist *)__pyx_v_self)); + __pyx_r = __pyx_pf_5arrex_4list_9typedlist_36__iter__(((struct __pyx_obj_5arrex_4list_typedlist *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_5arrex_4list_9typedlist_34__iter__(struct __pyx_obj_5arrex_4list_typedlist *__pyx_v_self) { +static PyObject *__pyx_pf_5arrex_4list_9typedlist_36__iter__(struct __pyx_obj_5arrex_4list_typedlist *__pyx_v_self) { struct __pyx_obj_5arrex_4list_arrayiter *__pyx_v_it = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -6212,19 +6472,19 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_34__iter__(struct __pyx_obj_5a int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__iter__", 0); - /* "arrex/list.pyx":497 + /* "arrex/list.pyx":518 * def __iter__(self): * ''' yield successive elements in the list ''' * cdef arrayiter it = arrayiter.__new__(arrayiter) # <<<<<<<<<<<<<< * it.array = self * it.position = 0 */ - __pyx_t_1 = ((PyObject *)__pyx_tp_new_5arrex_4list_arrayiter(((PyTypeObject *)__pyx_ptype_5arrex_4list_arrayiter), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 497, __pyx_L1_error) + __pyx_t_1 = ((PyObject *)__pyx_tp_new_5arrex_4list_arrayiter(((PyTypeObject *)__pyx_ptype_5arrex_4list_arrayiter), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __pyx_v_it = ((struct __pyx_obj_5arrex_4list_arrayiter *)__pyx_t_1); __pyx_t_1 = 0; - /* "arrex/list.pyx":498 + /* "arrex/list.pyx":519 * ''' yield successive elements in the list ''' * cdef arrayiter it = arrayiter.__new__(arrayiter) * it.array = self # <<<<<<<<<<<<<< @@ -6237,7 +6497,7 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_34__iter__(struct __pyx_obj_5a __Pyx_DECREF(((PyObject *)__pyx_v_it->array)); __pyx_v_it->array = __pyx_v_self; - /* "arrex/list.pyx":499 + /* "arrex/list.pyx":520 * cdef arrayiter it = arrayiter.__new__(arrayiter) * it.array = self * it.position = 0 # <<<<<<<<<<<<<< @@ -6246,7 +6506,7 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_34__iter__(struct __pyx_obj_5a */ __pyx_v_it->position = 0; - /* "arrex/list.pyx":500 + /* "arrex/list.pyx":521 * it.array = self * it.position = 0 * return it # <<<<<<<<<<<<<< @@ -6258,8 +6518,8 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_34__iter__(struct __pyx_obj_5a __pyx_r = ((PyObject *)__pyx_v_it); goto __pyx_L0; - /* "arrex/list.pyx":495 - * raise IndexError('index must be int') + /* "arrex/list.pyx":516 + * * * def __iter__(self): # <<<<<<<<<<<<<< * ''' yield successive elements in the list ''' @@ -6278,7 +6538,7 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_34__iter__(struct __pyx_obj_5a return __pyx_r; } -/* "arrex/list.pyx":502 +/* "arrex/list.pyx":523 * return it * * def __repr__(self): # <<<<<<<<<<<<<< @@ -6287,19 +6547,19 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_34__iter__(struct __pyx_obj_5a */ /* Python wrapper */ -static PyObject *__pyx_pw_5arrex_4list_9typedlist_37__repr__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_5arrex_4list_9typedlist_37__repr__(PyObject *__pyx_v_self) { +static PyObject *__pyx_pw_5arrex_4list_9typedlist_39__repr__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_5arrex_4list_9typedlist_39__repr__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); - __pyx_r = __pyx_pf_5arrex_4list_9typedlist_36__repr__(((struct __pyx_obj_5arrex_4list_typedlist *)__pyx_v_self)); + __pyx_r = __pyx_pf_5arrex_4list_9typedlist_38__repr__(((struct __pyx_obj_5arrex_4list_typedlist *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_5arrex_4list_9typedlist_36__repr__(struct __pyx_obj_5arrex_4list_typedlist *__pyx_v_self) { +static PyObject *__pyx_pf_5arrex_4list_9typedlist_38__repr__(struct __pyx_obj_5arrex_4list_typedlist *__pyx_v_self) { size_t __pyx_v_i; PyObject *__pyx_v_text = NULL; PyObject *__pyx_r = NULL; @@ -6315,7 +6575,7 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_36__repr__(struct __pyx_obj_5a int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__repr__", 0); - /* "arrex/list.pyx":504 + /* "arrex/list.pyx":525 * def __repr__(self): * cdef size_t i * text = 'typedlist([' # <<<<<<<<<<<<<< @@ -6325,7 +6585,7 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_36__repr__(struct __pyx_obj_5a __Pyx_INCREF(__pyx_kp_u_typedlist); __pyx_v_text = __pyx_kp_u_typedlist; - /* "arrex/list.pyx":505 + /* "arrex/list.pyx":526 * cdef size_t i * text = 'typedlist([' * for i in range(self._len()): # <<<<<<<<<<<<<< @@ -6337,7 +6597,7 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_36__repr__(struct __pyx_obj_5a for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { __pyx_v_i = __pyx_t_3; - /* "arrex/list.pyx":506 + /* "arrex/list.pyx":527 * text = 'typedlist([' * for i in range(self._len()): * if i: text += ', ' # <<<<<<<<<<<<<< @@ -6346,44 +6606,44 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_36__repr__(struct __pyx_obj_5a */ __pyx_t_4 = (__pyx_v_i != 0); if (__pyx_t_4) { - __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_text, __pyx_kp_u__13); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 506, __pyx_L1_error) + __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_text, __pyx_kp_u__12); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_text, __pyx_t_5); __pyx_t_5 = 0; } - /* "arrex/list.pyx":507 + /* "arrex/list.pyx":528 * for i in range(self._len()): * if i: text += ', ' * text += repr(self._getitem(self.ptr + i*self.dtype.dsize)) # <<<<<<<<<<<<<< * text += '])' * return text */ - __pyx_t_5 = ((struct __pyx_vtabstruct_5arrex_4list_typedlist *)__pyx_v_self->__pyx_vtab)->_getitem(__pyx_v_self, (__pyx_v_self->ptr + (__pyx_v_i * __pyx_v_self->dtype->dsize))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 507, __pyx_L1_error) + __pyx_t_5 = ((struct __pyx_vtabstruct_5arrex_4list_typedlist *)__pyx_v_self->__pyx_vtab)->_getitem(__pyx_v_self, (__pyx_v_self->ptr + (__pyx_v_i * __pyx_v_self->dtype->dsize))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 528, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyObject_Repr(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 507, __pyx_L1_error) + __pyx_t_6 = PyObject_Repr(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 528, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_text, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 507, __pyx_L1_error) + __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_text, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 528, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF_SET(__pyx_v_text, __pyx_t_5); __pyx_t_5 = 0; } - /* "arrex/list.pyx":508 + /* "arrex/list.pyx":529 * if i: text += ', ' * text += repr(self._getitem(self.ptr + i*self.dtype.dsize)) * text += '])' # <<<<<<<<<<<<<< * return text * */ - __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_text, __pyx_kp_u__14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 508, __pyx_L1_error) + __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_text, __pyx_kp_u__13); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 529, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_text, __pyx_t_5); __pyx_t_5 = 0; - /* "arrex/list.pyx":509 + /* "arrex/list.pyx":530 * text += repr(self._getitem(self.ptr + i*self.dtype.dsize)) * text += '])' * return text # <<<<<<<<<<<<<< @@ -6395,7 +6655,7 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_36__repr__(struct __pyx_obj_5a __pyx_r = __pyx_v_text; goto __pyx_L0; - /* "arrex/list.pyx":502 + /* "arrex/list.pyx":523 * return it * * def __repr__(self): # <<<<<<<<<<<<<< @@ -6416,7 +6676,7 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_36__repr__(struct __pyx_obj_5a return __pyx_r; } -/* "arrex/list.pyx":511 +/* "arrex/list.pyx":532 * return text * * def __eq__(self, other): # <<<<<<<<<<<<<< @@ -6425,23 +6685,23 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_36__repr__(struct __pyx_obj_5a */ /* Python wrapper */ -static PyObject *__pyx_pw_5arrex_4list_9typedlist_39__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ -static char __pyx_doc_5arrex_4list_9typedlist_38__eq__[] = " return True if other is a typedlist and its buffer byte contents is the same "; +static PyObject *__pyx_pw_5arrex_4list_9typedlist_41__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ +static char __pyx_doc_5arrex_4list_9typedlist_40__eq__[] = " return True if other is a typedlist and its buffer byte contents is the same "; #if CYTHON_COMPILING_IN_CPYTHON -struct wrapperbase __pyx_wrapperbase_5arrex_4list_9typedlist_38__eq__; +struct wrapperbase __pyx_wrapperbase_5arrex_4list_9typedlist_40__eq__; #endif -static PyObject *__pyx_pw_5arrex_4list_9typedlist_39__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { +static PyObject *__pyx_pw_5arrex_4list_9typedlist_41__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0); - __pyx_r = __pyx_pf_5arrex_4list_9typedlist_38__eq__(((struct __pyx_obj_5arrex_4list_typedlist *)__pyx_v_self), ((PyObject *)__pyx_v_other)); + __pyx_r = __pyx_pf_5arrex_4list_9typedlist_40__eq__(((struct __pyx_obj_5arrex_4list_typedlist *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_5arrex_4list_9typedlist_38__eq__(struct __pyx_obj_5arrex_4list_typedlist *__pyx_v_self, PyObject *__pyx_v_other) { +static PyObject *__pyx_pf_5arrex_4list_9typedlist_40__eq__(struct __pyx_obj_5arrex_4list_typedlist *__pyx_v_self, PyObject *__pyx_v_other) { struct __pyx_obj_5arrex_4list_typedlist *__pyx_v_o = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -6453,7 +6713,7 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_38__eq__(struct __pyx_obj_5arr int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__eq__", 0); - /* "arrex/list.pyx":513 + /* "arrex/list.pyx":534 * def __eq__(self, other): * ''' return True if other is a typedlist and its buffer byte contents is the same ''' * if not isinstance(other, typedlist): return False # <<<<<<<<<<<<<< @@ -6469,20 +6729,20 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_38__eq__(struct __pyx_obj_5arr goto __pyx_L0; } - /* "arrex/list.pyx":514 + /* "arrex/list.pyx":535 * ''' return True if other is a typedlist and its buffer byte contents is the same ''' * if not isinstance(other, typedlist): return False * cdef typedlist o = other # <<<<<<<<<<<<<< * if self.size != o.size: return False * return 0 == memcmp(self.ptr, o.ptr, self.size) */ - if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_5arrex_4list_typedlist))))) __PYX_ERR(0, 514, __pyx_L1_error) + if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_5arrex_4list_typedlist))))) __PYX_ERR(0, 535, __pyx_L1_error) __pyx_t_3 = __pyx_v_other; __Pyx_INCREF(__pyx_t_3); __pyx_v_o = ((struct __pyx_obj_5arrex_4list_typedlist *)__pyx_t_3); __pyx_t_3 = 0; - /* "arrex/list.pyx":515 + /* "arrex/list.pyx":536 * if not isinstance(other, typedlist): return False * cdef typedlist o = other * if self.size != o.size: return False # <<<<<<<<<<<<<< @@ -6497,7 +6757,7 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_38__eq__(struct __pyx_obj_5arr goto __pyx_L0; } - /* "arrex/list.pyx":516 + /* "arrex/list.pyx":537 * cdef typedlist o = other * if self.size != o.size: return False * return 0 == memcmp(self.ptr, o.ptr, self.size) # <<<<<<<<<<<<<< @@ -6505,13 +6765,13 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_38__eq__(struct __pyx_obj_5arr * def __copy__(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyBool_FromLong((0 == memcmp(__pyx_v_self->ptr, __pyx_v_o->ptr, __pyx_v_self->size))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyBool_FromLong((0 == memcmp(__pyx_v_self->ptr, __pyx_v_o->ptr, __pyx_v_self->size))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "arrex/list.pyx":511 + /* "arrex/list.pyx":532 * return text * * def __eq__(self, other): # <<<<<<<<<<<<<< @@ -6531,7 +6791,7 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_38__eq__(struct __pyx_obj_5arr return __pyx_r; } -/* "arrex/list.pyx":518 +/* "arrex/list.pyx":539 * return 0 == memcmp(self.ptr, o.ptr, self.size) * * def __copy__(self): # <<<<<<<<<<<<<< @@ -6540,20 +6800,20 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_38__eq__(struct __pyx_obj_5arr */ /* Python wrapper */ -static PyObject *__pyx_pw_5arrex_4list_9typedlist_41__copy__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_5arrex_4list_9typedlist_40__copy__[] = " shallow copy will create a copy of that array referencing the same buffer "; -static PyObject *__pyx_pw_5arrex_4list_9typedlist_41__copy__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_pw_5arrex_4list_9typedlist_43__copy__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_5arrex_4list_9typedlist_42__copy__[] = " shallow copy will create a copy of that array referencing the same buffer "; +static PyObject *__pyx_pw_5arrex_4list_9typedlist_43__copy__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__copy__ (wrapper)", 0); - __pyx_r = __pyx_pf_5arrex_4list_9typedlist_40__copy__(((struct __pyx_obj_5arrex_4list_typedlist *)__pyx_v_self)); + __pyx_r = __pyx_pf_5arrex_4list_9typedlist_42__copy__(((struct __pyx_obj_5arrex_4list_typedlist *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_5arrex_4list_9typedlist_40__copy__(struct __pyx_obj_5arrex_4list_typedlist *__pyx_v_self) { +static PyObject *__pyx_pf_5arrex_4list_9typedlist_42__copy__(struct __pyx_obj_5arrex_4list_typedlist *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -6562,7 +6822,7 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_40__copy__(struct __pyx_obj_5a int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__copy__", 0); - /* "arrex/list.pyx":520 + /* "arrex/list.pyx":541 * def __copy__(self): * ''' shallow copy will create a copy of that array referencing the same buffer ''' * return self[:] # <<<<<<<<<<<<<< @@ -6570,13 +6830,13 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_40__copy__(struct __pyx_obj_5a * def __deepcopy__(self, memo): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_self), 0, 0, NULL, NULL, &__pyx_slice__15, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_self), 0, 0, NULL, NULL, &__pyx_slice__14, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 541, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "arrex/list.pyx":518 + /* "arrex/list.pyx":539 * return 0 == memcmp(self.ptr, o.ptr, self.size) * * def __copy__(self): # <<<<<<<<<<<<<< @@ -6595,7 +6855,7 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_40__copy__(struct __pyx_obj_5a return __pyx_r; } -/* "arrex/list.pyx":522 +/* "arrex/list.pyx":543 * return self[:] * * def __deepcopy__(self, memo): # <<<<<<<<<<<<<< @@ -6604,20 +6864,20 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_40__copy__(struct __pyx_obj_5a */ /* Python wrapper */ -static PyObject *__pyx_pw_5arrex_4list_9typedlist_43__deepcopy__(PyObject *__pyx_v_self, PyObject *__pyx_v_memo); /*proto*/ -static char __pyx_doc_5arrex_4list_9typedlist_42__deepcopy__[] = " deep recursive copy, will duplicate the viewed data in the underlying buffer "; -static PyObject *__pyx_pw_5arrex_4list_9typedlist_43__deepcopy__(PyObject *__pyx_v_self, PyObject *__pyx_v_memo) { +static PyObject *__pyx_pw_5arrex_4list_9typedlist_45__deepcopy__(PyObject *__pyx_v_self, PyObject *__pyx_v_memo); /*proto*/ +static char __pyx_doc_5arrex_4list_9typedlist_44__deepcopy__[] = " deep recursive copy, will duplicate the viewed data in the underlying buffer "; +static PyObject *__pyx_pw_5arrex_4list_9typedlist_45__deepcopy__(PyObject *__pyx_v_self, PyObject *__pyx_v_memo) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__deepcopy__ (wrapper)", 0); - __pyx_r = __pyx_pf_5arrex_4list_9typedlist_42__deepcopy__(((struct __pyx_obj_5arrex_4list_typedlist *)__pyx_v_self), ((PyObject *)__pyx_v_memo)); + __pyx_r = __pyx_pf_5arrex_4list_9typedlist_44__deepcopy__(((struct __pyx_obj_5arrex_4list_typedlist *)__pyx_v_self), ((PyObject *)__pyx_v_memo)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_5arrex_4list_9typedlist_42__deepcopy__(struct __pyx_obj_5arrex_4list_typedlist *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_memo) { +static PyObject *__pyx_pf_5arrex_4list_9typedlist_44__deepcopy__(struct __pyx_obj_5arrex_4list_typedlist *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_memo) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -6627,7 +6887,7 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_42__deepcopy__(struct __pyx_ob int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__deepcopy__", 0); - /* "arrex/list.pyx":524 + /* "arrex/list.pyx":545 * def __deepcopy__(self, memo): * ''' deep recursive copy, will duplicate the viewed data in the underlying buffer ''' * return typedlist(PyBytes_FromStringAndSize(self.ptr, self.size), self.dtype) # <<<<<<<<<<<<<< @@ -6635,9 +6895,9 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_42__deepcopy__(struct __pyx_ob * def __reduce_ex__(self, protocol): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyBytes_FromStringAndSize(((char *)__pyx_v_self->ptr), __pyx_v_self->size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 524, __pyx_L1_error) + __pyx_t_1 = PyBytes_FromStringAndSize(((char *)__pyx_v_self->ptr), __pyx_v_self->size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 524, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); @@ -6645,14 +6905,14 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_42__deepcopy__(struct __pyx_ob __Pyx_GIVEREF(((PyObject *)__pyx_v_self->dtype)); PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self->dtype)); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5arrex_4list_typedlist), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 524, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5arrex_4list_typedlist), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "arrex/list.pyx":522 + /* "arrex/list.pyx":543 * return self[:] * * def __deepcopy__(self, memo): # <<<<<<<<<<<<<< @@ -6672,7 +6932,7 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_42__deepcopy__(struct __pyx_ob return __pyx_r; } -/* "arrex/list.pyx":526 +/* "arrex/list.pyx":547 * return typedlist(PyBytes_FromStringAndSize(self.ptr, self.size), self.dtype) * * def __reduce_ex__(self, protocol): # <<<<<<<<<<<<<< @@ -6681,20 +6941,20 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_42__deepcopy__(struct __pyx_ob */ /* Python wrapper */ -static PyObject *__pyx_pw_5arrex_4list_9typedlist_45__reduce_ex__(PyObject *__pyx_v_self, PyObject *__pyx_v_protocol); /*proto*/ -static char __pyx_doc_5arrex_4list_9typedlist_44__reduce_ex__[] = " serialization protocol "; -static PyObject *__pyx_pw_5arrex_4list_9typedlist_45__reduce_ex__(PyObject *__pyx_v_self, PyObject *__pyx_v_protocol) { +static PyObject *__pyx_pw_5arrex_4list_9typedlist_47__reduce_ex__(PyObject *__pyx_v_self, PyObject *__pyx_v_protocol); /*proto*/ +static char __pyx_doc_5arrex_4list_9typedlist_46__reduce_ex__[] = " serialization protocol "; +static PyObject *__pyx_pw_5arrex_4list_9typedlist_47__reduce_ex__(PyObject *__pyx_v_self, PyObject *__pyx_v_protocol) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_ex__ (wrapper)", 0); - __pyx_r = __pyx_pf_5arrex_4list_9typedlist_44__reduce_ex__(((struct __pyx_obj_5arrex_4list_typedlist *)__pyx_v_self), ((PyObject *)__pyx_v_protocol)); + __pyx_r = __pyx_pf_5arrex_4list_9typedlist_46__reduce_ex__(((struct __pyx_obj_5arrex_4list_typedlist *)__pyx_v_self), ((PyObject *)__pyx_v_protocol)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_5arrex_4list_9typedlist_44__reduce_ex__(struct __pyx_obj_5arrex_4list_typedlist *__pyx_v_self, PyObject *__pyx_v_protocol) { +static PyObject *__pyx_pf_5arrex_4list_9typedlist_46__reduce_ex__(struct __pyx_obj_5arrex_4list_typedlist *__pyx_v_self, PyObject *__pyx_v_protocol) { Py_buffer __pyx_v_view; PyObject *__pyx_v_stuff = NULL; PyObject *__pyx_r = NULL; @@ -6710,19 +6970,19 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_44__reduce_ex__(struct __pyx_o int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_ex__", 0); - /* "arrex/list.pyx":530 + /* "arrex/list.pyx":551 * cdef Py_buffer view * * if protocol >= 5: # <<<<<<<<<<<<<< * if not PyObject_CheckBuffer(self.owner): * raise RuntimeError("the buffer owner doens't implement the buffer protocol") */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_protocol, __pyx_int_5, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 530, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 530, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_protocol, __pyx_int_5, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 551, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 551, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "arrex/list.pyx":531 + /* "arrex/list.pyx":552 * * if protocol >= 5: * if not PyObject_CheckBuffer(self.owner): # <<<<<<<<<<<<<< @@ -6735,20 +6995,20 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_44__reduce_ex__(struct __pyx_o __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_t_2)) { - /* "arrex/list.pyx":532 + /* "arrex/list.pyx":553 * if protocol >= 5: * if not PyObject_CheckBuffer(self.owner): * raise RuntimeError("the buffer owner doens't implement the buffer protocol") # <<<<<<<<<<<<<< * PyObject_GetBuffer(self.owner, &view, PyBUF_SIMPLE) * stuff = ( */ - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 532, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 532, __pyx_L1_error) + __PYX_ERR(0, 553, __pyx_L1_error) - /* "arrex/list.pyx":531 + /* "arrex/list.pyx":552 * * if protocol >= 5: * if not PyObject_CheckBuffer(self.owner): # <<<<<<<<<<<<<< @@ -6757,7 +7017,7 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_44__reduce_ex__(struct __pyx_o */ } - /* "arrex/list.pyx":533 + /* "arrex/list.pyx":554 * if not PyObject_CheckBuffer(self.owner): * raise RuntimeError("the buffer owner doens't implement the buffer protocol") * PyObject_GetBuffer(self.owner, &view, PyBUF_SIMPLE) # <<<<<<<<<<<<<< @@ -6766,17 +7026,17 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_44__reduce_ex__(struct __pyx_o */ __pyx_t_1 = __pyx_v_self->owner; __Pyx_INCREF(__pyx_t_1); - __pyx_t_3 = PyObject_GetBuffer(__pyx_t_1, (&__pyx_v_view), PyBUF_SIMPLE); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 533, __pyx_L1_error) + __pyx_t_3 = PyObject_GetBuffer(__pyx_t_1, (&__pyx_v_view), PyBUF_SIMPLE); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 554, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "arrex/list.pyx":535 + /* "arrex/list.pyx":556 * PyObject_GetBuffer(self.owner, &view, PyBUF_SIMPLE) * stuff = ( * PickleBuffer(self.owner), # <<<<<<<<<<<<<< * self.dtype, * self.ptr - view.buf, */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_PickleBuffer); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 535, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_PickleBuffer); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -6790,38 +7050,38 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_44__reduce_ex__(struct __pyx_o } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_self->owner) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_self->owner); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 535, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "arrex/list.pyx":537 + /* "arrex/list.pyx":558 * PickleBuffer(self.owner), * self.dtype, * self.ptr - view.buf, # <<<<<<<<<<<<<< * self.size, * ) */ - __pyx_t_4 = __Pyx_PyInt_From_ptrdiff_t((__pyx_v_self->ptr - ((char *)__pyx_v_view.buf))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 537, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_ptrdiff_t((__pyx_v_self->ptr - ((char *)__pyx_v_view.buf))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - /* "arrex/list.pyx":538 + /* "arrex/list.pyx":559 * self.dtype, * self.ptr - view.buf, * self.size, # <<<<<<<<<<<<<< * ) * PyBuffer_Release(&view) */ - __pyx_t_5 = __Pyx_PyInt_FromSize_t(__pyx_v_self->size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 538, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_FromSize_t(__pyx_v_self->size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 559, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - /* "arrex/list.pyx":535 + /* "arrex/list.pyx":556 * PyObject_GetBuffer(self.owner, &view, PyBUF_SIMPLE) * stuff = ( * PickleBuffer(self.owner), # <<<<<<<<<<<<<< * self.dtype, * self.ptr - view.buf, */ - __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 535, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); @@ -6838,7 +7098,7 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_44__reduce_ex__(struct __pyx_o __pyx_v_stuff = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; - /* "arrex/list.pyx":540 + /* "arrex/list.pyx":561 * self.size, * ) * PyBuffer_Release(&view) # <<<<<<<<<<<<<< @@ -6847,7 +7107,7 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_44__reduce_ex__(struct __pyx_o */ PyBuffer_Release((&__pyx_v_view)); - /* "arrex/list.pyx":541 + /* "arrex/list.pyx":562 * ) * PyBuffer_Release(&view) * return self._rebuild, stuff, None # <<<<<<<<<<<<<< @@ -6855,9 +7115,9 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_44__reduce_ex__(struct __pyx_o * return self._rebuild, ( */ __Pyx_XDECREF(__pyx_r); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_rebuild); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 541, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_rebuild); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 541, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); @@ -6872,7 +7132,7 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_44__reduce_ex__(struct __pyx_o __pyx_t_5 = 0; goto __pyx_L0; - /* "arrex/list.pyx":530 + /* "arrex/list.pyx":551 * cdef Py_buffer view * * if protocol >= 5: # <<<<<<<<<<<<<< @@ -6881,7 +7141,7 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_44__reduce_ex__(struct __pyx_o */ } - /* "arrex/list.pyx":543 + /* "arrex/list.pyx":564 * return self._rebuild, stuff, None * else: * return self._rebuild, ( # <<<<<<<<<<<<<< @@ -6890,37 +7150,37 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_44__reduce_ex__(struct __pyx_o */ /*else*/ { __Pyx_XDECREF(__pyx_r); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_rebuild); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 543, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_rebuild); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - /* "arrex/list.pyx":544 + /* "arrex/list.pyx":565 * else: * return self._rebuild, ( * PyBytes_FromStringAndSize(self.ptr, self.size), # <<<<<<<<<<<<<< * self.dtype, * 0, */ - __pyx_t_6 = PyBytes_FromStringAndSize(((char *)__pyx_v_self->ptr), __pyx_v_self->size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 544, __pyx_L1_error) + __pyx_t_6 = PyBytes_FromStringAndSize(((char *)__pyx_v_self->ptr), __pyx_v_self->size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - /* "arrex/list.pyx":547 + /* "arrex/list.pyx":568 * self.dtype, * 0, * self.size, # <<<<<<<<<<<<<< * ) * */ - __pyx_t_4 = __Pyx_PyInt_FromSize_t(__pyx_v_self->size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 547, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_FromSize_t(__pyx_v_self->size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - /* "arrex/list.pyx":544 + /* "arrex/list.pyx":565 * else: * return self._rebuild, ( * PyBytes_FromStringAndSize(self.ptr, self.size), # <<<<<<<<<<<<<< * self.dtype, * 0, */ - __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 544, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); @@ -6935,14 +7195,14 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_44__reduce_ex__(struct __pyx_o __pyx_t_6 = 0; __pyx_t_4 = 0; - /* "arrex/list.pyx":543 + /* "arrex/list.pyx":564 * return self._rebuild, stuff, None * else: * return self._rebuild, ( # <<<<<<<<<<<<<< * PyBytes_FromStringAndSize(self.ptr, self.size), * self.dtype, */ - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 543, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); @@ -6955,7 +7215,7 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_44__reduce_ex__(struct __pyx_o goto __pyx_L0; } - /* "arrex/list.pyx":526 + /* "arrex/list.pyx":547 * return typedlist(PyBytes_FromStringAndSize(self.ptr, self.size), self.dtype) * * def __reduce_ex__(self, protocol): # <<<<<<<<<<<<<< @@ -6978,7 +7238,7 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_44__reduce_ex__(struct __pyx_o return __pyx_r; } -/* "arrex/list.pyx":551 +/* "arrex/list.pyx":572 * * @classmethod * def _rebuild(cls, owner, dtype, size_t start, size_t size): # <<<<<<<<<<<<<< @@ -6987,8 +7247,8 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_44__reduce_ex__(struct __pyx_o */ /* Python wrapper */ -static PyObject *__pyx_pw_5arrex_4list_9typedlist_47_rebuild(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pw_5arrex_4list_9typedlist_47_rebuild(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pw_5arrex_4list_9typedlist_49_rebuild(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_5arrex_4list_9typedlist_49_rebuild(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_owner = 0; PyObject *__pyx_v_dtype = 0; size_t __pyx_v_start; @@ -7026,23 +7286,23 @@ static PyObject *__pyx_pw_5arrex_4list_9typedlist_47_rebuild(PyObject *__pyx_v_c case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_rebuild", 1, 4, 4, 1); __PYX_ERR(0, 551, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_rebuild", 1, 4, 4, 1); __PYX_ERR(0, 572, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_rebuild", 1, 4, 4, 2); __PYX_ERR(0, 551, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_rebuild", 1, 4, 4, 2); __PYX_ERR(0, 572, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_rebuild", 1, 4, 4, 3); __PYX_ERR(0, 551, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_rebuild", 1, 4, 4, 3); __PYX_ERR(0, 572, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_rebuild") < 0)) __PYX_ERR(0, 551, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_rebuild") < 0)) __PYX_ERR(0, 572, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -7054,25 +7314,25 @@ static PyObject *__pyx_pw_5arrex_4list_9typedlist_47_rebuild(PyObject *__pyx_v_c } __pyx_v_owner = values[0]; __pyx_v_dtype = values[1]; - __pyx_v_start = __Pyx_PyInt_As_size_t(values[2]); if (unlikely((__pyx_v_start == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 551, __pyx_L3_error) - __pyx_v_size = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_size == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 551, __pyx_L3_error) + __pyx_v_start = __Pyx_PyInt_As_size_t(values[2]); if (unlikely((__pyx_v_start == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 572, __pyx_L3_error) + __pyx_v_size = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_size == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 572, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_rebuild", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 551, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_rebuild", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 572, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("arrex.list.typedlist._rebuild", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5arrex_4list_9typedlist_46_rebuild(((PyTypeObject*)__pyx_v_cls), __pyx_v_owner, __pyx_v_dtype, __pyx_v_start, __pyx_v_size); + __pyx_r = __pyx_pf_5arrex_4list_9typedlist_48_rebuild(((PyTypeObject*)__pyx_v_cls), __pyx_v_owner, __pyx_v_dtype, __pyx_v_start, __pyx_v_size); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_5arrex_4list_9typedlist_46_rebuild(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_owner, PyObject *__pyx_v_dtype, size_t __pyx_v_start, size_t __pyx_v_size) { +static PyObject *__pyx_pf_5arrex_4list_9typedlist_48_rebuild(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_owner, PyObject *__pyx_v_dtype, size_t __pyx_v_start, size_t __pyx_v_size) { struct __pyx_obj_5arrex_4list_typedlist *__pyx_v_new = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -7083,14 +7343,14 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_46_rebuild(CYTHON_UNUSED PyTyp int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_rebuild", 0); - /* "arrex/list.pyx":552 + /* "arrex/list.pyx":573 * @classmethod * def _rebuild(cls, owner, dtype, size_t start, size_t size): * new = typedlist(owner, dtype) # <<<<<<<<<<<<<< * assert start <= size * assert size <= new.size */ - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 552, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_owner); __Pyx_GIVEREF(__pyx_v_owner); @@ -7098,13 +7358,13 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_46_rebuild(CYTHON_UNUSED PyTyp __Pyx_INCREF(__pyx_v_dtype); __Pyx_GIVEREF(__pyx_v_dtype); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_dtype); - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5arrex_4list_typedlist), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 552, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5arrex_4list_typedlist), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_new = ((struct __pyx_obj_5arrex_4list_typedlist *)__pyx_t_2); __pyx_t_2 = 0; - /* "arrex/list.pyx":553 + /* "arrex/list.pyx":574 * def _rebuild(cls, owner, dtype, size_t start, size_t size): * new = typedlist(owner, dtype) * assert start <= size # <<<<<<<<<<<<<< @@ -7115,12 +7375,12 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_46_rebuild(CYTHON_UNUSED PyTyp if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((__pyx_v_start <= __pyx_v_size) != 0))) { PyErr_SetNone(PyExc_AssertionError); - __PYX_ERR(0, 553, __pyx_L1_error) + __PYX_ERR(0, 574, __pyx_L1_error) } } #endif - /* "arrex/list.pyx":554 + /* "arrex/list.pyx":575 * new = typedlist(owner, dtype) * assert start <= size * assert size <= new.size # <<<<<<<<<<<<<< @@ -7131,12 +7391,12 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_46_rebuild(CYTHON_UNUSED PyTyp if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((__pyx_v_size <= __pyx_v_new->size) != 0))) { PyErr_SetNone(PyExc_AssertionError); - __PYX_ERR(0, 554, __pyx_L1_error) + __PYX_ERR(0, 575, __pyx_L1_error) } } #endif - /* "arrex/list.pyx":555 + /* "arrex/list.pyx":576 * assert start <= size * assert size <= new.size * new.ptr = new.ptr + start # <<<<<<<<<<<<<< @@ -7145,7 +7405,7 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_46_rebuild(CYTHON_UNUSED PyTyp */ __pyx_v_new->ptr = (__pyx_v_new->ptr + __pyx_v_start); - /* "arrex/list.pyx":556 + /* "arrex/list.pyx":577 * assert size <= new.size * new.ptr = new.ptr + start * new.size = size # <<<<<<<<<<<<<< @@ -7154,7 +7414,7 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_46_rebuild(CYTHON_UNUSED PyTyp */ __pyx_v_new->size = __pyx_v_size; - /* "arrex/list.pyx":557 + /* "arrex/list.pyx":578 * new.ptr = new.ptr + start * new.size = size * return new # <<<<<<<<<<<<<< @@ -7166,7 +7426,7 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_46_rebuild(CYTHON_UNUSED PyTyp __pyx_r = ((PyObject *)__pyx_v_new); goto __pyx_L0; - /* "arrex/list.pyx":551 + /* "arrex/list.pyx":572 * * @classmethod * def _rebuild(cls, owner, dtype, size_t start, size_t size): # <<<<<<<<<<<<<< @@ -7187,7 +7447,7 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_46_rebuild(CYTHON_UNUSED PyTyp return __pyx_r; } -/* "arrex/list.pyx":559 +/* "arrex/list.pyx":580 * return new * * def __getbuffer__(self, Py_buffer *view, int flags): # <<<<<<<<<<<<<< @@ -7196,19 +7456,19 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_46_rebuild(CYTHON_UNUSED PyTyp */ /* Python wrapper */ -static CYTHON_UNUSED int __pyx_pw_5arrex_4list_9typedlist_49__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags); /*proto*/ -static CYTHON_UNUSED int __pyx_pw_5arrex_4list_9typedlist_49__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags) { +static CYTHON_UNUSED int __pyx_pw_5arrex_4list_9typedlist_51__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_pw_5arrex_4list_9typedlist_51__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); - __pyx_r = __pyx_pf_5arrex_4list_9typedlist_48__getbuffer__(((struct __pyx_obj_5arrex_4list_typedlist *)__pyx_v_self), ((Py_buffer *)__pyx_v_view), ((int)__pyx_v_flags)); + __pyx_r = __pyx_pf_5arrex_4list_9typedlist_50__getbuffer__(((struct __pyx_obj_5arrex_4list_typedlist *)__pyx_v_self), ((Py_buffer *)__pyx_v_view), ((int)__pyx_v_flags)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static int __pyx_pf_5arrex_4list_9typedlist_48__getbuffer__(struct __pyx_obj_5arrex_4list_typedlist *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags) { +static int __pyx_pf_5arrex_4list_9typedlist_50__getbuffer__(struct __pyx_obj_5arrex_4list_typedlist *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags) { struct __pyx_obj_5arrex_4list_arrayexposer *__pyx_v_exp = 0; PyObject *__pyx_v_fmt = NULL; int __pyx_r; @@ -7230,19 +7490,19 @@ static int __pyx_pf_5arrex_4list_9typedlist_48__getbuffer__(struct __pyx_obj_5ar __pyx_v_view->obj = Py_None; __Pyx_INCREF(Py_None); __Pyx_GIVEREF(__pyx_v_view->obj); - /* "arrex/list.pyx":560 + /* "arrex/list.pyx":581 * * def __getbuffer__(self, Py_buffer *view, int flags): * cdef arrayexposer exp = arrayexposer.__new__(arrayexposer) # <<<<<<<<<<<<<< * exp.owner = self.owner * exp.shape[0] = self._len() */ - __pyx_t_1 = ((PyObject *)__pyx_tp_new_5arrex_4list_arrayexposer(((PyTypeObject *)__pyx_ptype_5arrex_4list_arrayexposer), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 560, __pyx_L1_error) + __pyx_t_1 = ((PyObject *)__pyx_tp_new_5arrex_4list_arrayexposer(((PyTypeObject *)__pyx_ptype_5arrex_4list_arrayexposer), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 581, __pyx_L1_error) __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __pyx_v_exp = ((struct __pyx_obj_5arrex_4list_arrayexposer *)__pyx_t_1); __pyx_t_1 = 0; - /* "arrex/list.pyx":561 + /* "arrex/list.pyx":582 * def __getbuffer__(self, Py_buffer *view, int flags): * cdef arrayexposer exp = arrayexposer.__new__(arrayexposer) * exp.owner = self.owner # <<<<<<<<<<<<<< @@ -7257,7 +7517,7 @@ static int __pyx_pf_5arrex_4list_9typedlist_48__getbuffer__(struct __pyx_obj_5ar __pyx_v_exp->owner = __pyx_t_1; __pyx_t_1 = 0; - /* "arrex/list.pyx":562 + /* "arrex/list.pyx":583 * cdef arrayexposer exp = arrayexposer.__new__(arrayexposer) * exp.owner = self.owner * exp.shape[0] = self._len() # <<<<<<<<<<<<<< @@ -7266,7 +7526,7 @@ static int __pyx_pf_5arrex_4list_9typedlist_48__getbuffer__(struct __pyx_obj_5ar */ (__pyx_v_exp->shape[0]) = ((struct __pyx_vtabstruct_5arrex_4list_typedlist *)__pyx_v_self->__pyx_vtab)->_len(__pyx_v_self); - /* "arrex/list.pyx":564 + /* "arrex/list.pyx":585 * exp.shape[0] = self._len() * * assign_buffer_obj(view, None) # <<<<<<<<<<<<<< @@ -7275,7 +7535,7 @@ static int __pyx_pf_5arrex_4list_9typedlist_48__getbuffer__(struct __pyx_obj_5ar */ assign_buffer_obj(__pyx_v_view, Py_None); - /* "arrex/list.pyx":565 + /* "arrex/list.pyx":586 * * assign_buffer_obj(view, None) * view.obj = exp # <<<<<<<<<<<<<< @@ -7288,7 +7548,7 @@ static int __pyx_pf_5arrex_4list_9typedlist_48__getbuffer__(struct __pyx_obj_5ar __Pyx_DECREF(__pyx_v_view->obj); __pyx_v_view->obj = ((PyObject *)__pyx_v_exp); - /* "arrex/list.pyx":566 + /* "arrex/list.pyx":587 * assign_buffer_obj(view, None) * view.obj = exp * view.buf = self.ptr # <<<<<<<<<<<<<< @@ -7298,7 +7558,7 @@ static int __pyx_pf_5arrex_4list_9typedlist_48__getbuffer__(struct __pyx_obj_5ar __pyx_t_2 = __pyx_v_self->ptr; __pyx_v_view->buf = __pyx_t_2; - /* "arrex/list.pyx":567 + /* "arrex/list.pyx":588 * view.obj = exp * view.buf = self.ptr * view.len = self.size # <<<<<<<<<<<<<< @@ -7308,7 +7568,7 @@ static int __pyx_pf_5arrex_4list_9typedlist_48__getbuffer__(struct __pyx_obj_5ar __pyx_t_3 = __pyx_v_self->size; __pyx_v_view->len = __pyx_t_3; - /* "arrex/list.pyx":568 + /* "arrex/list.pyx":589 * view.buf = self.ptr * view.len = self.size * view.ndim = 1 # <<<<<<<<<<<<<< @@ -7317,7 +7577,7 @@ static int __pyx_pf_5arrex_4list_9typedlist_48__getbuffer__(struct __pyx_obj_5ar */ __pyx_v_view->ndim = 1; - /* "arrex/list.pyx":570 + /* "arrex/list.pyx":591 * view.ndim = 1 * * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< @@ -7327,7 +7587,7 @@ static int __pyx_pf_5arrex_4list_9typedlist_48__getbuffer__(struct __pyx_obj_5ar __pyx_t_4 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); if (__pyx_t_4) { - /* "arrex/list.pyx":571 + /* "arrex/list.pyx":592 * * if flags & PyBUF_FORMAT: * fmt = self.dtype.layout # <<<<<<<<<<<<<< @@ -7339,7 +7599,7 @@ static int __pyx_pf_5arrex_4list_9typedlist_48__getbuffer__(struct __pyx_obj_5ar __pyx_v_fmt = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "arrex/list.pyx":572 + /* "arrex/list.pyx":593 * if flags & PyBUF_FORMAT: * fmt = self.dtype.layout * if fmt is not None: # <<<<<<<<<<<<<< @@ -7350,7 +7610,7 @@ static int __pyx_pf_5arrex_4list_9typedlist_48__getbuffer__(struct __pyx_obj_5ar __pyx_t_5 = (__pyx_t_4 != 0); if (__pyx_t_5) { - /* "arrex/list.pyx":573 + /* "arrex/list.pyx":594 * fmt = self.dtype.layout * if fmt is not None: * view.itemsize = self.dtype.dsize # <<<<<<<<<<<<<< @@ -7360,7 +7620,7 @@ static int __pyx_pf_5arrex_4list_9typedlist_48__getbuffer__(struct __pyx_obj_5ar __pyx_t_3 = __pyx_v_self->dtype->dsize; __pyx_v_view->itemsize = __pyx_t_3; - /* "arrex/list.pyx":574 + /* "arrex/list.pyx":595 * if fmt is not None: * view.itemsize = self.dtype.dsize * view.format = PyBytes_AS_STRING(fmt) # <<<<<<<<<<<<<< @@ -7369,7 +7629,7 @@ static int __pyx_pf_5arrex_4list_9typedlist_48__getbuffer__(struct __pyx_obj_5ar */ __pyx_v_view->format = PyBytes_AS_STRING(__pyx_v_fmt); - /* "arrex/list.pyx":572 + /* "arrex/list.pyx":593 * if flags & PyBUF_FORMAT: * fmt = self.dtype.layout * if fmt is not None: # <<<<<<<<<<<<<< @@ -7379,7 +7639,7 @@ static int __pyx_pf_5arrex_4list_9typedlist_48__getbuffer__(struct __pyx_obj_5ar goto __pyx_L4; } - /* "arrex/list.pyx":576 + /* "arrex/list.pyx":597 * view.format = PyBytes_AS_STRING(fmt) * else: * view.itemsize = 1 # <<<<<<<<<<<<<< @@ -7389,7 +7649,7 @@ static int __pyx_pf_5arrex_4list_9typedlist_48__getbuffer__(struct __pyx_obj_5ar /*else*/ { __pyx_v_view->itemsize = 1; - /* "arrex/list.pyx":577 + /* "arrex/list.pyx":598 * else: * view.itemsize = 1 * view.format = 'B' # <<<<<<<<<<<<<< @@ -7400,7 +7660,7 @@ static int __pyx_pf_5arrex_4list_9typedlist_48__getbuffer__(struct __pyx_obj_5ar } __pyx_L4:; - /* "arrex/list.pyx":570 + /* "arrex/list.pyx":591 * view.ndim = 1 * * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< @@ -7410,7 +7670,7 @@ static int __pyx_pf_5arrex_4list_9typedlist_48__getbuffer__(struct __pyx_obj_5ar goto __pyx_L3; } - /* "arrex/list.pyx":579 + /* "arrex/list.pyx":600 * view.format = 'B' * else: * view.itemsize = 1 # <<<<<<<<<<<<<< @@ -7420,7 +7680,7 @@ static int __pyx_pf_5arrex_4list_9typedlist_48__getbuffer__(struct __pyx_obj_5ar /*else*/ { __pyx_v_view->itemsize = 1; - /* "arrex/list.pyx":580 + /* "arrex/list.pyx":601 * else: * view.itemsize = 1 * view.format = NULL # <<<<<<<<<<<<<< @@ -7431,7 +7691,7 @@ static int __pyx_pf_5arrex_4list_9typedlist_48__getbuffer__(struct __pyx_obj_5ar } __pyx_L3:; - /* "arrex/list.pyx":582 + /* "arrex/list.pyx":603 * view.format = NULL * * if flags & PyBUF_ND: # <<<<<<<<<<<<<< @@ -7441,7 +7701,7 @@ static int __pyx_pf_5arrex_4list_9typedlist_48__getbuffer__(struct __pyx_obj_5ar __pyx_t_5 = ((__pyx_v_flags & PyBUF_ND) != 0); if (__pyx_t_5) { - /* "arrex/list.pyx":583 + /* "arrex/list.pyx":604 * * if flags & PyBUF_ND: * view.suboffsets = NULL # <<<<<<<<<<<<<< @@ -7450,7 +7710,7 @@ static int __pyx_pf_5arrex_4list_9typedlist_48__getbuffer__(struct __pyx_obj_5ar */ __pyx_v_view->suboffsets = NULL; - /* "arrex/list.pyx":584 + /* "arrex/list.pyx":605 * if flags & PyBUF_ND: * view.suboffsets = NULL * view.strides = &view.itemsize # <<<<<<<<<<<<<< @@ -7459,7 +7719,7 @@ static int __pyx_pf_5arrex_4list_9typedlist_48__getbuffer__(struct __pyx_obj_5ar */ __pyx_v_view->strides = (&__pyx_v_view->itemsize); - /* "arrex/list.pyx":585 + /* "arrex/list.pyx":606 * view.suboffsets = NULL * view.strides = &view.itemsize * view.shape = exp.shape # <<<<<<<<<<<<<< @@ -7469,7 +7729,7 @@ static int __pyx_pf_5arrex_4list_9typedlist_48__getbuffer__(struct __pyx_obj_5ar __pyx_t_6 = __pyx_v_exp->shape; __pyx_v_view->shape = __pyx_t_6; - /* "arrex/list.pyx":582 + /* "arrex/list.pyx":603 * view.format = NULL * * if flags & PyBUF_ND: # <<<<<<<<<<<<<< @@ -7479,7 +7739,7 @@ static int __pyx_pf_5arrex_4list_9typedlist_48__getbuffer__(struct __pyx_obj_5ar goto __pyx_L5; } - /* "arrex/list.pyx":587 + /* "arrex/list.pyx":608 * view.shape = exp.shape * else: * view.shape = NULL # <<<<<<<<<<<<<< @@ -7491,7 +7751,7 @@ static int __pyx_pf_5arrex_4list_9typedlist_48__getbuffer__(struct __pyx_obj_5ar } __pyx_L5:; - /* "arrex/list.pyx":559 + /* "arrex/list.pyx":580 * return new * * def __getbuffer__(self, Py_buffer *view, int flags): # <<<<<<<<<<<<<< @@ -7523,7 +7783,7 @@ static int __pyx_pf_5arrex_4list_9typedlist_48__getbuffer__(struct __pyx_obj_5ar return __pyx_r; } -/* "arrex/list.pyx":590 +/* "arrex/list.pyx":611 * * * def __releasebuffer__(self, Py_buffer *view): # <<<<<<<<<<<<<< @@ -7532,17 +7792,17 @@ static int __pyx_pf_5arrex_4list_9typedlist_48__getbuffer__(struct __pyx_obj_5ar */ /* Python wrapper */ -static CYTHON_UNUSED void __pyx_pw_5arrex_4list_9typedlist_51__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_view); /*proto*/ -static CYTHON_UNUSED void __pyx_pw_5arrex_4list_9typedlist_51__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_view) { +static CYTHON_UNUSED void __pyx_pw_5arrex_4list_9typedlist_53__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_view); /*proto*/ +static CYTHON_UNUSED void __pyx_pw_5arrex_4list_9typedlist_53__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_view) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0); - __pyx_pf_5arrex_4list_9typedlist_50__releasebuffer__(((struct __pyx_obj_5arrex_4list_typedlist *)__pyx_v_self), ((Py_buffer *)__pyx_v_view)); + __pyx_pf_5arrex_4list_9typedlist_52__releasebuffer__(((struct __pyx_obj_5arrex_4list_typedlist *)__pyx_v_self), ((Py_buffer *)__pyx_v_view)); /* function exit code */ __Pyx_RefNannyFinishContext(); } -static void __pyx_pf_5arrex_4list_9typedlist_50__releasebuffer__(CYTHON_UNUSED struct __pyx_obj_5arrex_4list_typedlist *__pyx_v_self, Py_buffer *__pyx_v_view) { +static void __pyx_pf_5arrex_4list_9typedlist_52__releasebuffer__(CYTHON_UNUSED struct __pyx_obj_5arrex_4list_typedlist *__pyx_v_self, Py_buffer *__pyx_v_view) { struct __pyx_obj_5arrex_4list_arrayexposer *__pyx_v_exp = 0; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -7553,29 +7813,29 @@ static void __pyx_pf_5arrex_4list_9typedlist_50__releasebuffer__(CYTHON_UNUSED s int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__releasebuffer__", 0); - /* "arrex/list.pyx":591 + /* "arrex/list.pyx":612 * * def __releasebuffer__(self, Py_buffer *view): * cdef arrayexposer exp = view.obj # <<<<<<<<<<<<<< * print('** release buffer', sys.getrefcount(exp.owner)) * exp.owner = None */ - if (!(likely(((__pyx_v_view->obj) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_view->obj, __pyx_ptype_5arrex_4list_arrayexposer))))) __PYX_ERR(0, 591, __pyx_L1_error) + if (!(likely(((__pyx_v_view->obj) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_view->obj, __pyx_ptype_5arrex_4list_arrayexposer))))) __PYX_ERR(0, 612, __pyx_L1_error) __pyx_t_1 = __pyx_v_view->obj; __Pyx_INCREF(__pyx_t_1); __pyx_v_exp = ((struct __pyx_obj_5arrex_4list_arrayexposer *)__pyx_t_1); __pyx_t_1 = 0; - /* "arrex/list.pyx":592 + /* "arrex/list.pyx":613 * def __releasebuffer__(self, Py_buffer *view): * cdef arrayexposer exp = view.obj * print('** release buffer', sys.getrefcount(exp.owner)) # <<<<<<<<<<<<<< * exp.owner = None * view.obj = None */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 592, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 613, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_getrefcount); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 592, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_getrefcount); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 613, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -7590,10 +7850,10 @@ static void __pyx_pf_5arrex_4list_9typedlist_50__releasebuffer__(CYTHON_UNUSED s } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_exp->owner) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_exp->owner); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 592, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 613, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 592, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 613, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_kp_u_release_buffer); __Pyx_GIVEREF(__pyx_kp_u_release_buffer); @@ -7601,12 +7861,12 @@ static void __pyx_pf_5arrex_4list_9typedlist_50__releasebuffer__(CYTHON_UNUSED s __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 592, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 613, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "arrex/list.pyx":593 + /* "arrex/list.pyx":614 * cdef arrayexposer exp = view.obj * print('** release buffer', sys.getrefcount(exp.owner)) * exp.owner = None # <<<<<<<<<<<<<< @@ -7619,7 +7879,7 @@ static void __pyx_pf_5arrex_4list_9typedlist_50__releasebuffer__(CYTHON_UNUSED s __Pyx_DECREF(__pyx_v_exp->owner); __pyx_v_exp->owner = Py_None; - /* "arrex/list.pyx":594 + /* "arrex/list.pyx":615 * print('** release buffer', sys.getrefcount(exp.owner)) * exp.owner = None * view.obj = None # <<<<<<<<<<<<<< @@ -7632,7 +7892,7 @@ static void __pyx_pf_5arrex_4list_9typedlist_50__releasebuffer__(CYTHON_UNUSED s __Pyx_DECREF(__pyx_v_view->obj); __pyx_v_view->obj = Py_None; - /* "arrex/list.pyx":590 + /* "arrex/list.pyx":611 * * * def __releasebuffer__(self, Py_buffer *view): # <<<<<<<<<<<<<< @@ -7652,7 +7912,7 @@ static void __pyx_pf_5arrex_4list_9typedlist_50__releasebuffer__(CYTHON_UNUSED s __Pyx_RefNannyFinishContext(); } -/* "arrex/list.pyx":596 +/* "arrex/list.pyx":617 * view.obj = None * * def reverse(self): # <<<<<<<<<<<<<< @@ -7661,20 +7921,20 @@ static void __pyx_pf_5arrex_4list_9typedlist_50__releasebuffer__(CYTHON_UNUSED s */ /* Python wrapper */ -static PyObject *__pyx_pw_5arrex_4list_9typedlist_53reverse(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_5arrex_4list_9typedlist_52reverse[] = " reverse()\n\t\t\n\t\t\treverse the order of elementd contained \n\t\t"; -static PyObject *__pyx_pw_5arrex_4list_9typedlist_53reverse(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_pw_5arrex_4list_9typedlist_55reverse(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_5arrex_4list_9typedlist_54reverse[] = " reverse()\n\t\t\n\t\t\treverse the order of elementd contained \n\t\t"; +static PyObject *__pyx_pw_5arrex_4list_9typedlist_55reverse(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("reverse (wrapper)", 0); - __pyx_r = __pyx_pf_5arrex_4list_9typedlist_52reverse(((struct __pyx_obj_5arrex_4list_typedlist *)__pyx_v_self)); + __pyx_r = __pyx_pf_5arrex_4list_9typedlist_54reverse(((struct __pyx_obj_5arrex_4list_typedlist *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_5arrex_4list_9typedlist_52reverse(struct __pyx_obj_5arrex_4list_typedlist *__pyx_v_self) { +static PyObject *__pyx_pf_5arrex_4list_9typedlist_54reverse(struct __pyx_obj_5arrex_4list_typedlist *__pyx_v_self) { char *__pyx_v_temp; char *__pyx_v_first; char *__pyx_v_last; @@ -7684,7 +7944,7 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_52reverse(struct __pyx_obj_5ar int __pyx_t_2; __Pyx_RefNannySetupContext("reverse", 0); - /* "arrex/list.pyx":606 + /* "arrex/list.pyx":627 * cdef size_t i * * temp = PyMem_Malloc(self.dtype.dsize) # <<<<<<<<<<<<<< @@ -7693,7 +7953,7 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_52reverse(struct __pyx_obj_5ar */ __pyx_v_temp = ((char *)PyMem_Malloc(__pyx_v_self->dtype->dsize)); - /* "arrex/list.pyx":607 + /* "arrex/list.pyx":628 * * temp = PyMem_Malloc(self.dtype.dsize) * first = self.ptr # <<<<<<<<<<<<<< @@ -7703,7 +7963,7 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_52reverse(struct __pyx_obj_5ar __pyx_t_1 = __pyx_v_self->ptr; __pyx_v_first = __pyx_t_1; - /* "arrex/list.pyx":608 + /* "arrex/list.pyx":629 * temp = PyMem_Malloc(self.dtype.dsize) * first = self.ptr * last = self.ptr + self.size - self.dtype.dsize # <<<<<<<<<<<<<< @@ -7712,7 +7972,7 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_52reverse(struct __pyx_obj_5ar */ __pyx_v_last = ((__pyx_v_self->ptr + __pyx_v_self->size) - __pyx_v_self->dtype->dsize); - /* "arrex/list.pyx":609 + /* "arrex/list.pyx":630 * first = self.ptr * last = self.ptr + self.size - self.dtype.dsize * while first < last: # <<<<<<<<<<<<<< @@ -7723,7 +7983,7 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_52reverse(struct __pyx_obj_5ar __pyx_t_2 = ((((size_t)__pyx_v_first) < ((size_t)__pyx_v_last)) != 0); if (!__pyx_t_2) break; - /* "arrex/list.pyx":610 + /* "arrex/list.pyx":631 * last = self.ptr + self.size - self.dtype.dsize * while first < last: * memcpy(temp, first, self.dtype.dsize) # <<<<<<<<<<<<<< @@ -7732,7 +7992,7 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_52reverse(struct __pyx_obj_5ar */ (void)(memcpy(__pyx_v_temp, __pyx_v_first, __pyx_v_self->dtype->dsize)); - /* "arrex/list.pyx":611 + /* "arrex/list.pyx":632 * while first < last: * memcpy(temp, first, self.dtype.dsize) * memcpy(first, last, self.dtype.dsize) # <<<<<<<<<<<<<< @@ -7741,7 +8001,7 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_52reverse(struct __pyx_obj_5ar */ (void)(memcpy(__pyx_v_first, __pyx_v_last, __pyx_v_self->dtype->dsize)); - /* "arrex/list.pyx":612 + /* "arrex/list.pyx":633 * memcpy(temp, first, self.dtype.dsize) * memcpy(first, last, self.dtype.dsize) * memcpy(last, temp, self.dtype.dsize) # <<<<<<<<<<<<<< @@ -7750,7 +8010,7 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_52reverse(struct __pyx_obj_5ar */ (void)(memcpy(__pyx_v_last, __pyx_v_temp, __pyx_v_self->dtype->dsize)); - /* "arrex/list.pyx":613 + /* "arrex/list.pyx":634 * memcpy(first, last, self.dtype.dsize) * memcpy(last, temp, self.dtype.dsize) * first += self.dtype.dsize # <<<<<<<<<<<<<< @@ -7759,7 +8019,7 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_52reverse(struct __pyx_obj_5ar */ __pyx_v_first = (__pyx_v_first + __pyx_v_self->dtype->dsize); - /* "arrex/list.pyx":614 + /* "arrex/list.pyx":635 * memcpy(last, temp, self.dtype.dsize) * first += self.dtype.dsize * last -= self.dtype.dsize # <<<<<<<<<<<<<< @@ -7769,7 +8029,7 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_52reverse(struct __pyx_obj_5ar __pyx_v_last = (__pyx_v_last - __pyx_v_self->dtype->dsize); } - /* "arrex/list.pyx":615 + /* "arrex/list.pyx":636 * first += self.dtype.dsize * last -= self.dtype.dsize * PyMem_Free(temp) # <<<<<<<<<<<<<< @@ -7778,7 +8038,7 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_52reverse(struct __pyx_obj_5ar */ PyMem_Free(__pyx_v_temp); - /* "arrex/list.pyx":596 + /* "arrex/list.pyx":617 * view.obj = None * * def reverse(self): # <<<<<<<<<<<<<< @@ -7793,7 +8053,7 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_52reverse(struct __pyx_obj_5ar return __pyx_r; } -/* "arrex/list.pyx":617 +/* "arrex/list.pyx":638 * PyMem_Free(temp) * * def index(self, value): # <<<<<<<<<<<<<< @@ -7802,20 +8062,20 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_52reverse(struct __pyx_obj_5ar */ /* Python wrapper */ -static PyObject *__pyx_pw_5arrex_4list_9typedlist_55index(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static char __pyx_doc_5arrex_4list_9typedlist_54index[] = " index(value)\n\t\t\n\t\t\treturn the index of the first element binarily equal to the given one \n\t\t"; -static PyObject *__pyx_pw_5arrex_4list_9typedlist_55index(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { +static PyObject *__pyx_pw_5arrex_4list_9typedlist_57index(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static char __pyx_doc_5arrex_4list_9typedlist_56index[] = " index(value)\n\t\t\n\t\t\treturn the index of the first element binarily equal to the given one \n\t\t"; +static PyObject *__pyx_pw_5arrex_4list_9typedlist_57index(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("index (wrapper)", 0); - __pyx_r = __pyx_pf_5arrex_4list_9typedlist_54index(((struct __pyx_obj_5arrex_4list_typedlist *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + __pyx_r = __pyx_pf_5arrex_4list_9typedlist_56index(((struct __pyx_obj_5arrex_4list_typedlist *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_5arrex_4list_9typedlist_54index(struct __pyx_obj_5arrex_4list_typedlist *__pyx_v_self, PyObject *__pyx_v_value) { +static PyObject *__pyx_pf_5arrex_4list_9typedlist_56index(struct __pyx_obj_5arrex_4list_typedlist *__pyx_v_self, PyObject *__pyx_v_value) { size_t __pyx_v_i; size_t __pyx_v_j; char *__pyx_v_data; @@ -7831,7 +8091,7 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_54index(struct __pyx_obj_5arre int __pyx_clineno = 0; __Pyx_RefNannySetupContext("index", 0); - /* "arrex/list.pyx":626 + /* "arrex/list.pyx":647 * cdef char *val * * data = self.ptr # <<<<<<<<<<<<<< @@ -7840,7 +8100,7 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_54index(struct __pyx_obj_5arre */ __pyx_v_data = ((char *)__pyx_v_self->ptr); - /* "arrex/list.pyx":627 + /* "arrex/list.pyx":648 * * data = self.ptr * val = PyMem_Malloc(self.dtype.dsize) # <<<<<<<<<<<<<< @@ -7849,16 +8109,16 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_54index(struct __pyx_obj_5arre */ __pyx_v_val = ((char *)PyMem_Malloc(__pyx_v_self->dtype->dsize)); - /* "arrex/list.pyx":628 + /* "arrex/list.pyx":649 * data = self.ptr * val = PyMem_Malloc(self.dtype.dsize) * self._setitem(val, value) # <<<<<<<<<<<<<< * * i = 0 */ - __pyx_t_1 = ((struct __pyx_vtabstruct_5arrex_4list_typedlist *)__pyx_v_self->__pyx_vtab)->_setitem(__pyx_v_self, __pyx_v_val, __pyx_v_value); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 628, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_5arrex_4list_typedlist *)__pyx_v_self->__pyx_vtab)->_setitem(__pyx_v_self, __pyx_v_val, __pyx_v_value); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 649, __pyx_L1_error) - /* "arrex/list.pyx":630 + /* "arrex/list.pyx":651 * self._setitem(val, value) * * i = 0 # <<<<<<<<<<<<<< @@ -7867,7 +8127,7 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_54index(struct __pyx_obj_5arre */ __pyx_v_i = 0; - /* "arrex/list.pyx":631 + /* "arrex/list.pyx":652 * * i = 0 * while i < self.size: # <<<<<<<<<<<<<< @@ -7878,7 +8138,7 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_54index(struct __pyx_obj_5arre __pyx_t_2 = ((__pyx_v_i < __pyx_v_self->size) != 0); if (!__pyx_t_2) break; - /* "arrex/list.pyx":632 + /* "arrex/list.pyx":653 * i = 0 * while i < self.size: * j = 0 # <<<<<<<<<<<<<< @@ -7887,7 +8147,7 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_54index(struct __pyx_obj_5arre */ __pyx_v_j = 0; - /* "arrex/list.pyx":633 + /* "arrex/list.pyx":654 * while i < self.size: * j = 0 * while data[i+j] == val[j] and j < self.dtype.dsize: # <<<<<<<<<<<<<< @@ -7906,7 +8166,7 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_54index(struct __pyx_obj_5arre __pyx_L7_bool_binop_done:; if (!__pyx_t_2) break; - /* "arrex/list.pyx":634 + /* "arrex/list.pyx":655 * j = 0 * while data[i+j] == val[j] and j < self.dtype.dsize: * j += 1 # <<<<<<<<<<<<<< @@ -7916,7 +8176,7 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_54index(struct __pyx_obj_5arre __pyx_v_j = (__pyx_v_j + 1); } - /* "arrex/list.pyx":635 + /* "arrex/list.pyx":656 * while data[i+j] == val[j] and j < self.dtype.dsize: * j += 1 * if j == self.dtype.dsize: # <<<<<<<<<<<<<< @@ -7926,7 +8186,7 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_54index(struct __pyx_obj_5arre __pyx_t_2 = ((__pyx_v_j == __pyx_v_self->dtype->dsize) != 0); if (__pyx_t_2) { - /* "arrex/list.pyx":636 + /* "arrex/list.pyx":657 * j += 1 * if j == self.dtype.dsize: * PyMem_Free(val) # <<<<<<<<<<<<<< @@ -7935,7 +8195,7 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_54index(struct __pyx_obj_5arre */ PyMem_Free(__pyx_v_val); - /* "arrex/list.pyx":637 + /* "arrex/list.pyx":658 * if j == self.dtype.dsize: * PyMem_Free(val) * return i//self.dtype.dsize # <<<<<<<<<<<<<< @@ -7943,13 +8203,13 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_54index(struct __pyx_obj_5arre * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = __Pyx_PyInt_FromSize_t((__pyx_v_i / __pyx_v_self->dtype->dsize)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 637, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_FromSize_t((__pyx_v_i / __pyx_v_self->dtype->dsize)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 658, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; - /* "arrex/list.pyx":635 + /* "arrex/list.pyx":656 * while data[i+j] == val[j] and j < self.dtype.dsize: * j += 1 * if j == self.dtype.dsize: # <<<<<<<<<<<<<< @@ -7958,7 +8218,7 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_54index(struct __pyx_obj_5arre */ } - /* "arrex/list.pyx":638 + /* "arrex/list.pyx":659 * PyMem_Free(val) * return i//self.dtype.dsize * i += self.dtype.dsize # <<<<<<<<<<<<<< @@ -7968,7 +8228,7 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_54index(struct __pyx_obj_5arre __pyx_v_i = (__pyx_v_i + __pyx_v_self->dtype->dsize); } - /* "arrex/list.pyx":640 + /* "arrex/list.pyx":661 * i += self.dtype.dsize * * PyMem_Free(val) # <<<<<<<<<<<<<< @@ -7977,20 +8237,20 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_54index(struct __pyx_obj_5arre */ PyMem_Free(__pyx_v_val); - /* "arrex/list.pyx":641 + /* "arrex/list.pyx":662 * * PyMem_Free(val) * raise IndexError('value not found') # <<<<<<<<<<<<<< * * */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 641, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 662, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 641, __pyx_L1_error) + __PYX_ERR(0, 662, __pyx_L1_error) - /* "arrex/list.pyx":617 + /* "arrex/list.pyx":638 * PyMem_Free(temp) * * def index(self, value): # <<<<<<<<<<<<<< @@ -8140,7 +8400,7 @@ static PyObject *__pyx_pf_5arrex_4list_9typedlist_5owner___get__(struct __pyx_ob return __pyx_r; } -/* "arrex/list.pyx":647 +/* "arrex/list.pyx":668 * cdef class arrayexposer: * ''' very simple object that just holds the data for the buffer objects ''' * cdef readonly object owner # <<<<<<<<<<<<<< @@ -8475,7 +8735,7 @@ static PyObject *__pyx_pf_5arrex_4list_12arrayexposer_2__setstate_cython__(struc return __pyx_r; } -/* "arrex/list.pyx":656 +/* "arrex/list.pyx":677 * cdef size_t position * * def __init__(self): # <<<<<<<<<<<<<< @@ -8508,20 +8768,20 @@ static int __pyx_pf_5arrex_4list_9arrayiter___init__(CYTHON_UNUSED struct __pyx_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "arrex/list.pyx":657 + /* "arrex/list.pyx":678 * * def __init__(self): * raise TypeError('arrayiter must not be instanciated explicitely') # <<<<<<<<<<<<<< * * def __iter__(self): */ - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 657, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 678, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 657, __pyx_L1_error) + __PYX_ERR(0, 678, __pyx_L1_error) - /* "arrex/list.pyx":656 + /* "arrex/list.pyx":677 * cdef size_t position * * def __init__(self): # <<<<<<<<<<<<<< @@ -8538,7 +8798,7 @@ static int __pyx_pf_5arrex_4list_9arrayiter___init__(CYTHON_UNUSED struct __pyx_ return __pyx_r; } -/* "arrex/list.pyx":659 +/* "arrex/list.pyx":680 * raise TypeError('arrayiter must not be instanciated explicitely') * * def __iter__(self): # <<<<<<<<<<<<<< @@ -8564,7 +8824,7 @@ static PyObject *__pyx_pf_5arrex_4list_9arrayiter_2__iter__(struct __pyx_obj_5ar __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__", 0); - /* "arrex/list.pyx":660 + /* "arrex/list.pyx":681 * * def __iter__(self): * return self # <<<<<<<<<<<<<< @@ -8576,7 +8836,7 @@ static PyObject *__pyx_pf_5arrex_4list_9arrayiter_2__iter__(struct __pyx_obj_5ar __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; - /* "arrex/list.pyx":659 + /* "arrex/list.pyx":680 * raise TypeError('arrayiter must not be instanciated explicitely') * * def __iter__(self): # <<<<<<<<<<<<<< @@ -8591,7 +8851,7 @@ static PyObject *__pyx_pf_5arrex_4list_9arrayiter_2__iter__(struct __pyx_obj_5ar return __pyx_r; } -/* "arrex/list.pyx":662 +/* "arrex/list.pyx":683 * return self * * def __next__(self): # <<<<<<<<<<<<<< @@ -8623,7 +8883,7 @@ static PyObject *__pyx_pf_5arrex_4list_9arrayiter_4__next__(struct __pyx_obj_5ar int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__next__", 0); - /* "arrex/list.pyx":663 + /* "arrex/list.pyx":684 * * def __next__(self): * if self.position + self.array.dtype.dsize > self.array.size: # <<<<<<<<<<<<<< @@ -8633,7 +8893,7 @@ static PyObject *__pyx_pf_5arrex_4list_9arrayiter_4__next__(struct __pyx_obj_5ar __pyx_t_1 = (((__pyx_v_self->position + __pyx_v_self->array->dtype->dsize) > __pyx_v_self->array->size) != 0); if (unlikely(__pyx_t_1)) { - /* "arrex/list.pyx":664 + /* "arrex/list.pyx":685 * def __next__(self): * if self.position + self.array.dtype.dsize > self.array.size: * raise StopIteration # <<<<<<<<<<<<<< @@ -8641,9 +8901,9 @@ static PyObject *__pyx_pf_5arrex_4list_9arrayiter_4__next__(struct __pyx_obj_5ar * self.position += self.array.dtype.dsize */ __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0); - __PYX_ERR(0, 664, __pyx_L1_error) + __PYX_ERR(0, 685, __pyx_L1_error) - /* "arrex/list.pyx":663 + /* "arrex/list.pyx":684 * * def __next__(self): * if self.position + self.array.dtype.dsize > self.array.size: # <<<<<<<<<<<<<< @@ -8652,19 +8912,19 @@ static PyObject *__pyx_pf_5arrex_4list_9arrayiter_4__next__(struct __pyx_obj_5ar */ } - /* "arrex/list.pyx":665 + /* "arrex/list.pyx":686 * if self.position + self.array.dtype.dsize > self.array.size: * raise StopIteration * item = self.array._getitem(self.array.ptr + self.position) # <<<<<<<<<<<<<< * self.position += self.array.dtype.dsize * return item */ - __pyx_t_2 = ((struct __pyx_vtabstruct_5arrex_4list_typedlist *)__pyx_v_self->array->__pyx_vtab)->_getitem(__pyx_v_self->array, (__pyx_v_self->array->ptr + __pyx_v_self->position)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 665, __pyx_L1_error) + __pyx_t_2 = ((struct __pyx_vtabstruct_5arrex_4list_typedlist *)__pyx_v_self->array->__pyx_vtab)->_getitem(__pyx_v_self->array, (__pyx_v_self->array->ptr + __pyx_v_self->position)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 686, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_item = __pyx_t_2; __pyx_t_2 = 0; - /* "arrex/list.pyx":666 + /* "arrex/list.pyx":687 * raise StopIteration * item = self.array._getitem(self.array.ptr + self.position) * self.position += self.array.dtype.dsize # <<<<<<<<<<<<<< @@ -8673,7 +8933,7 @@ static PyObject *__pyx_pf_5arrex_4list_9arrayiter_4__next__(struct __pyx_obj_5ar */ __pyx_v_self->position = (__pyx_v_self->position + __pyx_v_self->array->dtype->dsize); - /* "arrex/list.pyx":667 + /* "arrex/list.pyx":688 * item = self.array._getitem(self.array.ptr + self.position) * self.position += self.array.dtype.dsize * return item # <<<<<<<<<<<<<< @@ -8685,7 +8945,7 @@ static PyObject *__pyx_pf_5arrex_4list_9arrayiter_4__next__(struct __pyx_obj_5ar __pyx_r = __pyx_v_item; goto __pyx_L0; - /* "arrex/list.pyx":662 + /* "arrex/list.pyx":683 * return self * * def __next__(self): # <<<<<<<<<<<<<< @@ -10432,20 +10692,18 @@ static int __pyx_mp_ass_subscript_5arrex_4list_typedlist(PyObject *o, PyObject * return __pyx_pw_5arrex_4list_9typedlist_33__setitem__(o, i, v); } else { - PyErr_Format(PyExc_NotImplementedError, - "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name); - return -1; + return __pyx_pw_5arrex_4list_9typedlist_35__delitem__(o, i); } } static PyObject *__pyx_tp_richcompare_5arrex_4list_typedlist(PyObject *o1, PyObject *o2, int op) { switch (op) { case Py_EQ: { - return __pyx_pw_5arrex_4list_9typedlist_39__eq__(o1, o2); + return __pyx_pw_5arrex_4list_9typedlist_41__eq__(o1, o2); } case Py_NE: { PyObject *ret; - ret = __pyx_pw_5arrex_4list_9typedlist_39__eq__(o1, o2); + ret = __pyx_pw_5arrex_4list_9typedlist_41__eq__(o1, o2); if (likely(ret && ret != Py_NotImplemented)) { int b = __Pyx_PyObject_IsTrue(ret); Py_DECREF(ret); if (unlikely(b < 0)) return NULL; @@ -10491,12 +10749,12 @@ static PyMethodDef __pyx_methods_5arrex_4list_typedlist[] = { {"extend", (PyCFunction)__pyx_pw_5arrex_4list_9typedlist_17extend, METH_O, __pyx_doc_5arrex_4list_9typedlist_16extend}, {"capacity", (PyCFunction)__pyx_pw_5arrex_4list_9typedlist_25capacity, METH_NOARGS, __pyx_doc_5arrex_4list_9typedlist_24capacity}, {"shrink", (PyCFunction)__pyx_pw_5arrex_4list_9typedlist_27shrink, METH_NOARGS, __pyx_doc_5arrex_4list_9typedlist_26shrink}, - {"__copy__", (PyCFunction)__pyx_pw_5arrex_4list_9typedlist_41__copy__, METH_NOARGS, __pyx_doc_5arrex_4list_9typedlist_40__copy__}, - {"__deepcopy__", (PyCFunction)__pyx_pw_5arrex_4list_9typedlist_43__deepcopy__, METH_O, __pyx_doc_5arrex_4list_9typedlist_42__deepcopy__}, - {"__reduce_ex__", (PyCFunction)__pyx_pw_5arrex_4list_9typedlist_45__reduce_ex__, METH_O, __pyx_doc_5arrex_4list_9typedlist_44__reduce_ex__}, - {"_rebuild", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5arrex_4list_9typedlist_47_rebuild, METH_VARARGS|METH_KEYWORDS, 0}, - {"reverse", (PyCFunction)__pyx_pw_5arrex_4list_9typedlist_53reverse, METH_NOARGS, __pyx_doc_5arrex_4list_9typedlist_52reverse}, - {"index", (PyCFunction)__pyx_pw_5arrex_4list_9typedlist_55index, METH_O, __pyx_doc_5arrex_4list_9typedlist_54index}, + {"__copy__", (PyCFunction)__pyx_pw_5arrex_4list_9typedlist_43__copy__, METH_NOARGS, __pyx_doc_5arrex_4list_9typedlist_42__copy__}, + {"__deepcopy__", (PyCFunction)__pyx_pw_5arrex_4list_9typedlist_45__deepcopy__, METH_O, __pyx_doc_5arrex_4list_9typedlist_44__deepcopy__}, + {"__reduce_ex__", (PyCFunction)__pyx_pw_5arrex_4list_9typedlist_47__reduce_ex__, METH_O, __pyx_doc_5arrex_4list_9typedlist_46__reduce_ex__}, + {"_rebuild", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5arrex_4list_9typedlist_49_rebuild, METH_VARARGS|METH_KEYWORDS, 0}, + {"reverse", (PyCFunction)__pyx_pw_5arrex_4list_9typedlist_55reverse, METH_NOARGS, __pyx_doc_5arrex_4list_9typedlist_54reverse}, + {"index", (PyCFunction)__pyx_pw_5arrex_4list_9typedlist_57index, METH_O, __pyx_doc_5arrex_4list_9typedlist_56index}, {0, 0, 0, 0} }; @@ -10603,8 +10861,8 @@ static PyBufferProcs __pyx_tp_as_buffer_typedlist = { #if PY_MAJOR_VERSION < 3 0, /*bf_getcharbuffer*/ #endif - __pyx_pw_5arrex_4list_9typedlist_49__getbuffer__, /*bf_getbuffer*/ - __pyx_pw_5arrex_4list_9typedlist_51__releasebuffer__, /*bf_releasebuffer*/ + __pyx_pw_5arrex_4list_9typedlist_51__getbuffer__, /*bf_getbuffer*/ + __pyx_pw_5arrex_4list_9typedlist_53__releasebuffer__, /*bf_releasebuffer*/ }; static PyTypeObject __pyx_type_5arrex_4list_typedlist = { @@ -10627,7 +10885,7 @@ static PyTypeObject __pyx_type_5arrex_4list_typedlist = { #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif - __pyx_pw_5arrex_4list_9typedlist_37__repr__, /*tp_repr*/ + __pyx_pw_5arrex_4list_9typedlist_39__repr__, /*tp_repr*/ &__pyx_tp_as_number_typedlist, /*tp_as_number*/ &__pyx_tp_as_sequence_typedlist, /*tp_as_sequence*/ &__pyx_tp_as_mapping_typedlist, /*tp_as_mapping*/ @@ -10643,7 +10901,7 @@ static PyTypeObject __pyx_type_5arrex_4list_typedlist = { __pyx_tp_clear_5arrex_4list_typedlist, /*tp_clear*/ __pyx_tp_richcompare_5arrex_4list_typedlist, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ - __pyx_pw_5arrex_4list_9typedlist_35__iter__, /*tp_iter*/ + __pyx_pw_5arrex_4list_9typedlist_37__iter__, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_5arrex_4list_typedlist, /*tp_methods*/ 0, /*tp_members*/ @@ -10992,8 +11250,8 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_StopIteration, __pyx_k_StopIteration, sizeof(__pyx_k_StopIteration), 0, 0, 1, 1}, {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, + {&__pyx_kp_u__12, __pyx_k__12, sizeof(__pyx_k__12), 0, 1, 0, 0}, {&__pyx_kp_u__13, __pyx_k__13, sizeof(__pyx_k__13), 0, 1, 0, 0}, - {&__pyx_kp_u__14, __pyx_k__14, sizeof(__pyx_k__14), 0, 1, 0, 0}, {&__pyx_kp_u_amount_must_be_positive, __pyx_k_amount_must_be_positive, sizeof(__pyx_k_amount_must_be_positive), 0, 1, 0, 0}, {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1}, {&__pyx_n_s_array, __pyx_k_array, sizeof(__pyx_k_array), 0, 0, 1, 1}, @@ -11017,7 +11275,6 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_kp_u_incorrect_slice, __pyx_k_incorrect_slice, sizeof(__pyx_k_incorrect_slice), 0, 1, 0, 0}, {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1}, - {&__pyx_kp_u_index_must_be_int, __pyx_k_index_must_be_int, sizeof(__pyx_k_index_must_be_int), 0, 1, 0, 0}, {&__pyx_kp_u_index_must_be_int_or_slice, __pyx_k_index_must_be_int_or_slice, sizeof(__pyx_k_index_must_be_int_or_slice), 0, 1, 0, 0}, {&__pyx_kp_u_index_out_of_range, __pyx_k_index_out_of_range, sizeof(__pyx_k_index_out_of_range), 0, 1, 0, 0}, {&__pyx_n_u_iter, __pyx_k_iter, sizeof(__pyx_k_iter), 0, 1, 0, 1}, @@ -11074,8 +11331,8 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 182, __pyx_L1_error) __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 241, __pyx_L1_error) __pyx_builtin_NotImplemented = __Pyx_GetBuiltinName(__pyx_n_s_NotImplemented); if (!__pyx_builtin_NotImplemented) __PYX_ERR(0, 383, __pyx_L1_error) - __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 532, __pyx_L1_error) - __pyx_builtin_print = __Pyx_GetBuiltinName(__pyx_n_s_print); if (!__pyx_builtin_print) __PYX_ERR(0, 592, __pyx_L1_error) + __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 553, __pyx_L1_error) + __pyx_builtin_print = __Pyx_GetBuiltinName(__pyx_n_s_print); if (!__pyx_builtin_print) __PYX_ERR(0, 613, __pyx_L1_error) __pyx_builtin_OverflowError = __Pyx_GetBuiltinName(__pyx_n_s_OverflowError); if (!__pyx_builtin_OverflowError) __PYX_ERR(1, 81, __pyx_L1_error) __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 84, __pyx_L1_error) return 0; @@ -11208,60 +11465,49 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); - /* "arrex/list.pyx":493 - * - * else: - * raise IndexError('index must be int') # <<<<<<<<<<<<<< - * - * def __iter__(self): - */ - __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_u_index_must_be_int); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 493, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__12); - __Pyx_GIVEREF(__pyx_tuple__12); - - /* "arrex/list.pyx":520 + /* "arrex/list.pyx":541 * def __copy__(self): * ''' shallow copy will create a copy of that array referencing the same buffer ''' * return self[:] # <<<<<<<<<<<<<< * * def __deepcopy__(self, memo): */ - __pyx_slice__15 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__15)) __PYX_ERR(0, 520, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__15); - __Pyx_GIVEREF(__pyx_slice__15); + __pyx_slice__14 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__14)) __PYX_ERR(0, 541, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__14); + __Pyx_GIVEREF(__pyx_slice__14); - /* "arrex/list.pyx":532 + /* "arrex/list.pyx":553 * if protocol >= 5: * if not PyObject_CheckBuffer(self.owner): * raise RuntimeError("the buffer owner doens't implement the buffer protocol") # <<<<<<<<<<<<<< * PyObject_GetBuffer(self.owner, &view, PyBUF_SIMPLE) * stuff = ( */ - __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_u_the_buffer_owner_doens_t_impleme); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 532, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__16); - __Pyx_GIVEREF(__pyx_tuple__16); + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_u_the_buffer_owner_doens_t_impleme); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 553, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); - /* "arrex/list.pyx":641 + /* "arrex/list.pyx":662 * * PyMem_Free(val) * raise IndexError('value not found') # <<<<<<<<<<<<<< * * */ - __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_u_value_not_found); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 641, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__17); - __Pyx_GIVEREF(__pyx_tuple__17); + __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_u_value_not_found); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 662, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); - /* "arrex/list.pyx":657 + /* "arrex/list.pyx":678 * * def __init__(self): * raise TypeError('arrayiter must not be instanciated explicitely') # <<<<<<<<<<<<<< * * def __iter__(self): */ - __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_u_arrayiter_must_not_be_instanciat); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 657, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__18); - __Pyx_GIVEREF(__pyx_tuple__18); + __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_u_arrayiter_must_not_be_instanciat); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 678, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); /* "arrex/list.pyx":175 * @@ -11270,10 +11516,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * ''' full(value, size) * */ - __pyx_tuple__19 = PyTuple_Pack(5, __pyx_n_s_value, __pyx_n_s_size, __pyx_n_s_dtype, __pyx_n_s_i, __pyx_n_s_array); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 175, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__19); - __Pyx_GIVEREF(__pyx_tuple__19); - __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_arrex_list_pyx, __pyx_n_s_full, 175, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 175, __pyx_L1_error) + __pyx_tuple__18 = PyTuple_Pack(5, __pyx_n_s_value, __pyx_n_s_size, __pyx_n_s_dtype, __pyx_n_s_i, __pyx_n_s_array); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); + __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_arrex_list_pyx, __pyx_n_s_full, 175, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 175, __pyx_L1_error) /* "arrex/list.pyx":188 * @@ -11282,24 +11528,24 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * ''' empty(dtype, size) * */ - __pyx_tuple__21 = PyTuple_Pack(3, __pyx_n_s_dtype, __pyx_n_s_size, __pyx_n_s_array); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 188, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__21); - __Pyx_GIVEREF(__pyx_tuple__21); - __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_arrex_list_pyx, __pyx_n_s_empty, 188, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 188, __pyx_L1_error) + __pyx_tuple__20 = PyTuple_Pack(3, __pyx_n_s_dtype, __pyx_n_s_size, __pyx_n_s_array); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 188, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__20); + __Pyx_GIVEREF(__pyx_tuple__20); + __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_arrex_list_pyx, __pyx_n_s_empty, 188, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 188, __pyx_L1_error) /* "(tree fragment)":1 * def __pyx_unpickle_arrayexposer(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ - __pyx_tuple__23 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__23); - __Pyx_GIVEREF(__pyx_tuple__23); - __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_arrayexposer, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(1, 1, __pyx_L1_error) - __pyx_tuple__25 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__25); - __Pyx_GIVEREF(__pyx_tuple__25); - __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_arrayiter, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_tuple__22 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__22); + __Pyx_GIVEREF(__pyx_tuple__22); + __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_arrayexposer, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_tuple__24 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__24); + __Pyx_GIVEREF(__pyx_tuple__24); + __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_arrayiter, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -11310,6 +11556,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_26530323 = PyInt_FromLong(26530323L); if (unlikely(!__pyx_int_26530323)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_211671663 = PyInt_FromLong(211671663L); if (unlikely(!__pyx_int_211671663)) __PYX_ERR(0, 1, __pyx_L1_error) @@ -11417,9 +11664,9 @@ static int __Pyx_modinit_type_init_code(void) { { PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_5arrex_4list_typedlist, "__iter__"); if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error) if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) { - __pyx_wrapperbase_5arrex_4list_9typedlist_34__iter__ = *((PyWrapperDescrObject *)wrapper)->d_base; - __pyx_wrapperbase_5arrex_4list_9typedlist_34__iter__.doc = __pyx_doc_5arrex_4list_9typedlist_34__iter__; - ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5arrex_4list_9typedlist_34__iter__; + __pyx_wrapperbase_5arrex_4list_9typedlist_36__iter__ = *((PyWrapperDescrObject *)wrapper)->d_base; + __pyx_wrapperbase_5arrex_4list_9typedlist_36__iter__.doc = __pyx_doc_5arrex_4list_9typedlist_36__iter__; + ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5arrex_4list_9typedlist_36__iter__; } } #endif @@ -11427,34 +11674,34 @@ static int __Pyx_modinit_type_init_code(void) { { PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_5arrex_4list_typedlist, "__eq__"); if (unlikely(!wrapper)) __PYX_ERR(0, 45, __pyx_L1_error) if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) { - __pyx_wrapperbase_5arrex_4list_9typedlist_38__eq__ = *((PyWrapperDescrObject *)wrapper)->d_base; - __pyx_wrapperbase_5arrex_4list_9typedlist_38__eq__.doc = __pyx_doc_5arrex_4list_9typedlist_38__eq__; - ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5arrex_4list_9typedlist_38__eq__; + __pyx_wrapperbase_5arrex_4list_9typedlist_40__eq__ = *((PyWrapperDescrObject *)wrapper)->d_base; + __pyx_wrapperbase_5arrex_4list_9typedlist_40__eq__.doc = __pyx_doc_5arrex_4list_9typedlist_40__eq__; + ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5arrex_4list_9typedlist_40__eq__; } } #endif if (__Pyx_SetVtable(__pyx_type_5arrex_4list_typedlist.tp_dict, __pyx_vtabptr_5arrex_4list_typedlist) < 0) __PYX_ERR(0, 45, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_n_s_typedlist_2, (PyObject *)&__pyx_type_5arrex_4list_typedlist) < 0) __PYX_ERR(0, 45, __pyx_L1_error) __pyx_ptype_5arrex_4list_typedlist = &__pyx_type_5arrex_4list_typedlist; - if (PyType_Ready(&__pyx_type_5arrex_4list_arrayexposer) < 0) __PYX_ERR(0, 645, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_5arrex_4list_arrayexposer) < 0) __PYX_ERR(0, 666, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_5arrex_4list_arrayexposer.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_5arrex_4list_arrayexposer.tp_dictoffset && __pyx_type_5arrex_4list_arrayexposer.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_5arrex_4list_arrayexposer.tp_getattro = __Pyx_PyObject_GenericGetAttr; } - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_arrayexposer, (PyObject *)&__pyx_type_5arrex_4list_arrayexposer) < 0) __PYX_ERR(0, 645, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject*)&__pyx_type_5arrex_4list_arrayexposer) < 0) __PYX_ERR(0, 645, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_arrayexposer, (PyObject *)&__pyx_type_5arrex_4list_arrayexposer) < 0) __PYX_ERR(0, 666, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_5arrex_4list_arrayexposer) < 0) __PYX_ERR(0, 666, __pyx_L1_error) __pyx_ptype_5arrex_4list_arrayexposer = &__pyx_type_5arrex_4list_arrayexposer; - if (PyType_Ready(&__pyx_type_5arrex_4list_arrayiter) < 0) __PYX_ERR(0, 652, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_5arrex_4list_arrayiter) < 0) __PYX_ERR(0, 673, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_5arrex_4list_arrayiter.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_5arrex_4list_arrayiter.tp_dictoffset && __pyx_type_5arrex_4list_arrayiter.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_5arrex_4list_arrayiter.tp_getattro = __Pyx_PyObject_GenericGetAttr; } - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_arrayiter, (PyObject *)&__pyx_type_5arrex_4list_arrayiter) < 0) __PYX_ERR(0, 652, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject*)&__pyx_type_5arrex_4list_arrayiter) < 0) __PYX_ERR(0, 652, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_arrayiter, (PyObject *)&__pyx_type_5arrex_4list_arrayiter) < 0) __PYX_ERR(0, 673, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_5arrex_4list_arrayiter) < 0) __PYX_ERR(0, 673, __pyx_L1_error) __pyx_ptype_5arrex_4list_arrayiter = &__pyx_type_5arrex_4list_arrayiter; __Pyx_RefNannyFinishContext(); return 0; @@ -11837,27 +12084,27 @@ if (!__Pyx_RefNanny) { __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_5arrex_4list_typedlist); - /* "arrex/list.pyx":551 + /* "arrex/list.pyx":572 * * @classmethod * def _rebuild(cls, owner, dtype, size_t start, size_t size): # <<<<<<<<<<<<<< * new = typedlist(owner, dtype) * assert start <= size */ - __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_5arrex_4list_typedlist, __pyx_n_s_rebuild); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 551, __pyx_L1_error) + __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_5arrex_4list_typedlist, __pyx_n_s_rebuild); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - /* "arrex/list.pyx":550 + /* "arrex/list.pyx":571 * ) * * @classmethod # <<<<<<<<<<<<<< * def _rebuild(cls, owner, dtype, size_t start, size_t size): * new = typedlist(owner, dtype) */ - __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 550, __pyx_L1_error) + __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_5arrex_4list_typedlist->tp_dict, __pyx_n_s_rebuild, __pyx_t_1) < 0) __PYX_ERR(0, 551, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_ptype_5arrex_4list_typedlist->tp_dict, __pyx_n_s_rebuild, __pyx_t_1) < 0) __PYX_ERR(0, 572, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyType_Modified(__pyx_ptype_5arrex_4list_typedlist); @@ -12836,6 +13083,130 @@ static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *nam return 0; } +/* PyIntBinop */ +#if !CYTHON_COMPILING_IN_PYPY +static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) { + (void)inplace; + (void)zerodivision_check; + #if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(op1))) { + const long b = intval; + long x; + long a = PyInt_AS_LONG(op1); + x = (long)((unsigned long)a + b); + if (likely((x^a) >= 0 || (x^b) >= 0)) + return PyInt_FromLong(x); + return PyLong_Type.tp_as_number->nb_add(op1, op2); + } + #endif + #if CYTHON_USE_PYLONG_INTERNALS + if (likely(PyLong_CheckExact(op1))) { + const long b = intval; + long a, x; +#ifdef HAVE_LONG_LONG + const PY_LONG_LONG llb = intval; + PY_LONG_LONG lla, llx; +#endif + const digit* digits = ((PyLongObject*)op1)->ob_digit; + const Py_ssize_t size = Py_SIZE(op1); + if (likely(__Pyx_sst_abs(size) <= 1)) { + a = likely(size) ? digits[0] : 0; + if (size == -1) a = -a; + } else { + switch (size) { + case -2: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + CYTHON_FALLTHROUGH; + case 2: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + CYTHON_FALLTHROUGH; + case -3: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + CYTHON_FALLTHROUGH; + case 3: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + CYTHON_FALLTHROUGH; + case -4: + if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + CYTHON_FALLTHROUGH; + case 4: + if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + CYTHON_FALLTHROUGH; + default: return PyLong_Type.tp_as_number->nb_add(op1, op2); + } + } + x = a + b; + return PyLong_FromLong(x); +#ifdef HAVE_LONG_LONG + long_long: + llx = lla + llb; + return PyLong_FromLongLong(llx); +#endif + + + } + #endif + if (PyFloat_CheckExact(op1)) { + const long b = intval; + double a = PyFloat_AS_DOUBLE(op1); + double result; + PyFPE_START_PROTECT("add", return NULL) + result = ((double)a) + (double)b; + PyFPE_END_PROTECT(result) + return PyFloat_FromDouble(result); + } + return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2); +} +#endif + /* ExtTypeTest */ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { if (unlikely(!type)) { diff --git a/arrex/numbers.c b/arrex/numbers.c index 52a46dd..828280b 100644 --- a/arrex/numbers.c +++ b/arrex/numbers.c @@ -1,4 +1,4 @@ -/* Generated by Cython 0.29.26 */ +/* Generated by Cython 0.29.28 */ /* BEGIN: Cython Metadata { @@ -22,8 +22,8 @@ END: Cython Metadata */ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else -#define CYTHON_ABI "0_29_26" -#define CYTHON_HEX_VERSION 0x001D1AF0 +#define CYTHON_ABI "0_29_28" +#define CYTHON_HEX_VERSION 0x001D1CF0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof @@ -185,7 +185,10 @@ END: Cython Metadata */ #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif - #ifndef CYTHON_FAST_THREAD_STATE + #if PY_VERSION_HEX >= 0x030B00A4 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #elif !defined(CYTHON_FAST_THREAD_STATE) #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_PYCALL @@ -200,7 +203,10 @@ END: Cython Metadata */ #ifndef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) #endif - #ifndef CYTHON_USE_EXC_INFO_STACK + #if PY_VERSION_HEX >= 0x030B00A4 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 + #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) #endif #endif