title: cython: memory view of ndarray of strings (or direct ndarray indexing)
body: <p>How does one specify a memory view of a ndarray that contains strings?</p>
  
  <p><code>char[:]</code>, <code>char*[:]</code>, ... do not work.</p>
  
  <p>To illustrate, my problem is the definition of function <code>abc(...)</code>:</p>
  
  <pre><code>cdef void abc(char[:] in_buffer):
      cdef char * element
      element = address(in_buffer[1])
      ...
  
  def main():
      cdef Py_ssize_t i, n = 100
  
      a = np.array(['ABC', 'D', 'EFGHI'])
      for i in range(n):
          abc(a)
  </code></pre>
  
  <p>If a memoryview is not possible, can I implement direct array access myself? I need to avoid the GIL for function <code>abc(...)</code>.</p>
  
  <hr>
  
  <p><strong>Edit 1:</strong> In response to Bi Rico's answer.</p>
  
  <p>My aim is to release the GIL for function <code>abc(...)</code> and within it process the string elements of <code>ndarray in_buffer</code> with c string-functions. I.e. something like the following:</p>
  
  <pre><code>cdef void abc(char[:, ::1] in_buffer) nogil:
      cdef int max_elt_length = in_buffer.shape[1]+1
      cdef char element[max_elt_length+1]
      cdef int length
  
      for i in range(in_buffer.shape[0]+1):  # is this equivalent to in_buffer.dtype.itemsize + 1 ?
         element[max_elt_length] = 0   # add null-terminator for full-size elements
         memcpy(element, address(buffer[i, 0]), max_length)
         length = strlen(element)
         ...
  </code></pre>