title: ASCII string as dtype for numpy array of strings in Python 3
body: <p>NumPy's <code>string</code> dtype seems to correspond to Python's <code>str</code> and thus to change between Python 2.x and 3.x:</p>
  
  <p>In Python 2.7:</p>
  
  <pre><code>In [1]: import numpy as np
  
  In [2]: np.dtype((np.str_, 1)).itemsize
  Out[2]: 1
  
  In [3]: np.dtype((np.unicode_, 1)).itemsize
  Out[3]: 4
  </code></pre>
  
  <p>In Python 3.3:</p>
  
  <pre><code>In [2]: np.dtype((np.str_, 1)).itemsize
  Out[2]: 4
  </code></pre>
  
  <p>The version of NumPy is 1.7.0 in both cases.</p>
  
  <p>I'm writing some code that I want to work on both Python versions, and I want an array of ASCII strings (4x memory overhead is not acceptable). So the questions are:</p>
  
  <ul>
  <li>How do I define a dtype for an ASCII string of certain length (with 1 byte per char) in Python 3?</li>
  <li>How do I do it in a way that also works in Python 2?</li>
  <li>Bonus question: Can I limit the alphabet even further, e.g. to <code>ascii_uppercase</code>, and save a bit or two per char?</li>
  </ul>
  
  <p>Something that I see as the potential answer are character arrays for the first question (i.e. have an array of character arrays instead of an array of strings). Seems like I can specify the item size when constructing one:</p>
  
  <pre><code>chararray(shape, itemsize=1, unicode=False, buffer=None, offset=0,
            strides=None, order=None)
  </code></pre>
  
  <p>Update: nah, the <code>itemsize</code> is actually the number of characters. But there's still <code>unicode=False</code>.</p>
  
  <p>Is that the way to go?</p>
  
  <p>Will it answer the last question, too?</p>
  
  <p>And how do I actually use it as <code>dtype</code>?</p>