title: numba - TypingError: cannot determine Numba type of <class 'builtin_function_or_method'>
body: <p>I have a simple function to rank poker hands (the hands are strings).</p>
  <p>I call it with <code>rA,rB = rank(a),rank(b)</code> and here is my implementation. Works well without @jit(nopython=True), but with it, it fails:</p>
  <pre><code>   File &quot;...poker.py&quot;, line 190, in &lt;module&gt;
          rA,rB = rank(a),rank(b)
      
        File &quot;C:\Continuum\anaconda3\lib\site-packages\numba\dispatcher.py&quot;, line 344, in _compile_for_args
          reraise(type(e), e, None)
      
        File &quot;C:\Continuum\anaconda3\lib\site-packages\numba\six.py&quot;, line 658, in reraise
          raise value.with_traceback(tb)
  
  TypingError: cannot determine Numba type of &lt;class 'builtin_function_or_method'&gt;
  </code></pre>
  <hr />
  <pre><code>from numba import jit
  from numba.types import string
  
  @jit(nopython=True)
  def rank(hand):
  #    assert(len(hand) == 5)
      rank = &quot;N/A&quot;
      
      p = pd.Series([h[0] for h in hand]).value_counts()
      v = sorted(set(pd.Series([h[0] for h in hand]).values), reverse=True)
      s = sorted(hand, key=lambda k:k[0])    
      z = zip(s,s[1:])
      
      if all(x[0]==y[0]-1 for x,y in z):
          rank = &quot;Straight &quot;
      
      if len(set([h[1] for h in hand])) == 1:
          rank += &quot;Flush &quot;
      
      if &quot;Straight Flush&quot; in rank and sum([h[0] for h in hand]) == sum([10,11,12,13,14]):
          rank = &quot;Royal Flush&quot;
      
      elif p[p.idxmax()] == 4:
          rank = &quot;4 Of A Kind : %d&quot; % p.idxmax()
          
      elif p[p.idxmax()] == 3 and p[p.idxmin()] == 1:
          rank = &quot;3 Of A Kind : %d&quot; % p.idxmax()
          
      elif p[p.idxmax()] == 3 and p[p.idxmin()] == 2:
          rank = &quot;Full House : %d,%d&quot; % (p.idxmax(), p.idxmin())
          
      elif p[p.idxmax()] == 2:
          max2 = p.nlargest(2)
          
          if list(max2) == [2,2]:
              max2 = sorted(list(max2.keys()), reverse=True)
              rank = &quot;2 Pairs : %d,%d&quot; % (max2[0],max2[1])
          else:
              rank = &quot;Pair : %d&quot; % p.idxmax()
      
      else:
          rank = &quot;High Card : %d&quot; % v[0]
      
  
      return rank
  </code></pre>