title: Is there a way to include string attributes in numba jitclass?
body: <p>I understand strings are now supported by numba, but could not find any documentation for how to use strings with jitclass and was unable to figure it out. </p>
  
  <p>How do you create string attributes with jitclass?</p>
  
  <p>(This hack was pre-string support and fairly messy: <a href="https://stackoverflow.com/questions/48987368/how-can-i-pass-string-type-in-class-in-numba-jitclass-python">How can I pass string type in class in numba jitclass python?</a>)</p>
  
  <p>I have tried unicode_type, char, char[:], uint8, str -- basically everything I can think of.</p>
  
  <pre><code>COND_SPEC = [
      ('feature',nb.unicode_type),
      ('val', nb.unicode_type)
  ]
  
  @jitclass(COND_SPEC)
  class Cond:
      """ Class implementing conditional. """
  
      def __init__(self, feature, val):
          self.feature = feature
          self.val = val
  
  </code></pre>
  
  <p>The class compiles, but declaring an instance of the class produces an error:</p>
  
  <pre><code>c = Cond('education','HS-grad')
  </code></pre>
  
  <pre><code>numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend)
  Cannot cast unicode_type to int8: %".37" = load {i8*, i64, i32, i64, i8*, i8*}, {i8*, i64, i32, i64, i8*, i8*}* %"feature"
  
  File "&lt;ipython-input-19-aaeb1c1955cb&gt;", line 12:
      def __init__(self, feature, val):
          self.feature = feature
          ^
  
  [1] During: lowering "(self).feature = feature" at &lt;ipython-input-19-aaeb1c1955cb&gt; (12)
  [2] During: resolving callee type: jitclass.Cond#7f9c36758a18&lt;feature:int8,val:int8&gt;
  [3] During: typing of call at &lt;string&gt; (3)
  
  --%&lt;----------------------------------------------------------------------------
  
  
  File "&lt;string&gt;", line 3:
  &lt;source missing, REPL/exec in use?&gt;
  </code></pre>