title: Converting Python 3 bytes object to string when bytes object apparently only contains characters
body: <p>I'm new to Python 3 and it seems that I can't quite completely grasp unicode and character encoding.</p>
  
  <p>I'm working with the output of another tool that returns the content of an html page as a bytes object. Other tools we use need this output to be in bytes type, but, I'd like to convert the bytes output to a string for some parsing and comparison to other strings. For cases that I'm interested in, printing the output bytes object shows only characters and no \x or \u binary. I'm a little confused on how best to do this and why the methods that create the desired output, actually do work.</p>
  
  <p>I've read elsewhere that .decode() should be used in this context and this does work, but I don't understand why I am decoding an object that is already characters. From what I understand, decoding is intended for binary numbers, for example:</p>
  
  <pre><code>&gt;&gt;&gt; b'\x41'.decode('utf-8')
  'A'
  </code></pre>
  
  <p>In my understanding, all I really want to do is tell Python that an object that's been labeled as a bytes type object is actually a str object. Simply using the str() function on the bytes object also accomplishes this goal, but adds the "b" prefix and adds quotations around the string.</p>
  
  <p>Here are the two solutions I'm working with:</p>
  
  <pre><code>&gt;&gt;&gt; str(b'htmltext')
  "b'htmltext'"
  
  &gt;&gt;&gt; b'htmltext'.decode('utf-8')
  'htmltext'
  </code></pre>
  
  <p>Essentially, either of these solutions appears to achieve what I'm looking for, but the decode() obviously seems cleaner and, from what I've read, the recommended method. I'm wondering why decode() works, given that, apparently, I'm not converting binary numbers to characters. Furthermore, is there any reason other than the unappealing "b" and quotation marks in the output that str() would not be a valid solution here?</p>