Using 'is not' in Python
<p>I am trying to cursor search through some records in an access table from a field called DEV_TYPE. I want to compare each record against a list of know values I have built earlier in my script:</p>

<blockquote>
  <p>(devcatList)</p>
</blockquote>

<p>I want to print out any values that do not occur in the list. Some of the values in the records are Null as well. I want to set my if statement to only print out values that do not occur in the list, but I also do not want to print out 'None' for the Null values. My script is as follows:</p>

<pre><code>if field.name == "DEV_TYPE":
for iRow in arcpy.SearchCursor(fc):
      if not iRow.DEV_TYPE is None or iRow.DEV_TYPE not in devcatList:
          print str(iRow.OBJECTID) + " - " + str(iRow.DEV_TYPE)
</code></pre>

<p>I've played around with the '<code>if not x is None</code>' to '<code>if x is not None</code>'. Changed the '<code>or</code>' to and '<code>and</code>' (even though it was counter intuitive), but my printouts either return all values or no values or only '<code>None</code>'....basically everything I don't want. I'm sure I'm doing something silly. Can someone point out what my silliness is?</p>

<p>Thanks,
Mike</p>
