title: Python str vs unicode types
body: <p>Working with Python 2.7, I'm wondering what real advantage there is in using the type <code>unicode</code> instead of <code>str</code>, as both of them seem to be able to hold Unicode strings. Is there any special reason apart from being able to set Unicode codes in <code>unicode</code> strings using the escape char <code>\</code>?:</p>
  <p>Executing a module with:</p>
  <pre><code># -*- coding: utf-8 -*-
  
  a = 'á'
  ua = u'á'
  print a, ua
  </code></pre>
  <p>Results in: á, á</p>
  <p>More testing using Python shell:</p>
  <pre><code>&gt;&gt;&gt; a = 'á'
  &gt;&gt;&gt; a
  '\xc3\xa1'
  &gt;&gt;&gt; ua = u'á'
  &gt;&gt;&gt; ua
  u'\xe1'
  &gt;&gt;&gt; ua.encode('utf8')
  '\xc3\xa1'
  &gt;&gt;&gt; ua.encode('latin1')
  '\xe1'
  &gt;&gt;&gt; ua
  u'\xe1'
  </code></pre>
  <p>So, the <code>unicode</code> string seems to be encoded using <code>latin1</code> instead of <code>utf-8</code> and the raw string is encoded using <code>utf-8</code>? I'm even more confused now! :S</p>