title: Why must I cast int to bool before checking "is True"?
body: <p>In my url.py file in Django, I have the following line:</p>
  
  <pre><code>if bool(settings.DEBUG) is True:
  </code></pre>
  
  <p>This works well because settings.DEBUG == 1 therefore it equals True after the bool() function. However, I needed to add the bool() to make it work. The original line was not working and the original line was:</p>
  
  <pre><code>if settings.DEBUG is True:
  </code></pre>
  
  <p>This always evaluates to False, even when settings.DEBUG == 1.</p>
  
  <p>Why is the value 1 evaluating to False when I do not cast it explicitly to bool?</p>
  
  <p>In other words, why doesn't "1 is True" evaluate true?</p>
  
  <p>Note that I am using python 3 in case that matters to the answer.</p>