title: Wrote a function to determine if a number is a positive integer and it returns True for negative numbers
body: <p>I defined the following function to test if an input is a positive int. I plan on using eval(raw_input("...")) so that's why the try-except part is there:</p>
  
  <pre><code>def is_ok(x):           # checks if x is a positive integer
      is_int = False
      is_pos = False
      try:
          if type(eval(x)) == int:
              is_int = True
              if x &gt; 0:
                  is_pos = True
              else:
                  pass
          else:
              pass
  
      except NameError:
          is_int = False
          print "not even a number!"
  
      return is_int, is_pos 
  </code></pre>
  
  <p>if I try to pass a positive int it would return True, True as expected.
  It returns False, False and the error message for a non-number.</p>
  
  <p>However, for negative numbers it still returns True for checking if it's positive.
  For example, adding this after the function :</p>
  
  <pre><code>is_int, is_pos = is_ok("-9")
  
  print is_int, is_pos
  </code></pre>
  
  <p>running prints:
  True True</p>
  
  <p>Can't understand why that is and would love your help.
  Even if there are more efficient ways to accomplish this, I'd still like to understand why it produces True True.
  Thanks!</p>
  
  <p>(This is somewhat of a followup to: <a href="https://stackoverflow.com/questions/21975403/python-how-do-i-assign-2-values-i-return-from-a-function-with-1-input-as-values">Python: How do I assign 2 values I return from a function with 1 input as values outside the function?</a>)</p>