title: split byte string into lines
body: <p>How can I split a byte string into a list of lines?</p>
  
  <p>In python 2 I had:</p>
  
  <pre><code>rest = "some\nlines"
  for line in rest.split("\n"):
      print line
  </code></pre>
  
  <p>The code above is simplified for the sake of brevity, but now after some regex processing, I have a byte array in <code>rest</code> and I need to iterate the lines.</p>