title: python strings and binary data
body: <p>My question is about python 3.0 strings.</p>
  
  <ol>
  <li><p>My understanding is that for the line <code>str = "a"</code>, the charcter 'a' is encoded (using utf-8 - for example) and stored in the str object. If UTF-8 representation of 'a' is 1 byte the string is 1 byte long. Am I right?</p></li>
  <li><p>if the above is true what happens when we read a binary file using read(). Suppose I have a two byte file with two bytes of binary data and I read it in a string using read command like</p>
  
  <pre><code>open(fileName, mode='rb') 
      str= file.read()
  </code></pre>
  
  <p>now <code>str</code> will be two bytes long and each byte will be what was stored in the fileName. Am I right?</p></li>
  <li><p>If I am right in the above point then the str object is not in any particual encoding format (like UTF, etc.), So what does it mean that python strings are always unicode? Also what will happen if I call str.encode(). It will make no sense?</p></li>
  <li><p>As the <code>str</code> object read from file is actually a array of bytes. Is there any way to convert it to bytearray type?</p></li>
  </ol>