title: Why does base64.b64encode() return a bytes object?
body: <p>The purpose of <code>base64.b64encode()</code> is to convert binary data into ASCII-safe "text". However, the method returns an object of type bytes:</p>
  
  <pre><code>&gt;&gt;&gt; import base64
  &gt;&gt;&gt; base64.b64encode(b'abc')
  b'YWJj'
  </code></pre>
  
  <p>It's easy to simply take that output and <code>decode()</code> it, but my question is: what is a significance of <code>base64.b64encode()</code> returning <code>bytes</code> rather than a <code>str</code>?</p>