title: Best way to convert string to bytes in Python 3?
body: <p><a href="https://stackoverflow.com/questions/5471158/typeerror-str-does-not-support-the-buffer-interface">TypeError: &#39;str&#39; does not support the buffer interface</a> suggests two possible methods to convert a string to bytes:</p>
  <pre><code>b = bytes(mystring, 'utf-8')
  
  b = mystring.encode('utf-8')
  </code></pre>
  <p>Which method is more Pythonic?</p>