[Cython] Bug Report: can't assign zero length array to contiguous 2D memoryview

2013-11-06 Thread Josh Ayers
Assigning a NumPy array with a zero length dimension to a memoryview fails if the memoryview is declared contiguous in the zero-length dimension. I'm getting a run-time error that the buffer is not C-contiguous or Fortran contiguous. See examples below. Thanks, Josh Ayers cdef

[Cython] PyUnicode_Tailmatch

2015-07-07 Thread Josh Ayers
. For reference, there was previously an error in the Python documentation of this function. The documentation mistakenly said it returned an int. This was fixed via Python issue 22580: https://bugs.python.org/issue22580. Thanks, Josh Ayers ___ cython

[Cython] Cython 0.23.3 compiler warning with fused types

2015-10-03 Thread Josh Ayers
warning because a long is assigned to a char. char __pyx_v_kind; ... long __pyx_t_11; ... __pyx_t_11 = __Pyx_PyObject_Ord(__pyx_t_8); ... __pyx_v_kind = __pyx_t_11; Thanks, Josh Ayers ___ cython-devel mailing list cython-devel@python.org https

Re: [Cython] can we deprecate for-from loops?

2015-10-12 Thread Josh Ayers
When the step size is a variable, the range statement falls back to a Python for loop since the direction of the loop is unknown. The "i from a <= i < b by c" syntax specifies the direction, so it is turned into a C for loop. The difference is performance could be substantial. This produces a Py