title: Why does Python treat a tuple with one item as an integer?
body: <p>See the following example:      </p>
  
  <pre><code>(1) #outputs 1
  </code></pre>
  
  <p>But if I add the comma, it will be right according to the Python docs:)</p>
  
  <pre><code>(1,) #output (1,)
  </code></pre>
  
  <p>That's super odd to me. Can anyone explain this?    </p>
  
  <p>A related question: Is there not a way for Python to know when (1) should be a tuple (1,) instead of 1?    </p>
  
  <p>Thanks for future replies.</p>