title: Efficient concatenation of byte data in python without creating a huge list?
body: <p>Doing some computation that results in strings that contain byte data (the strings serve as byte arrays). Now this data needs to be sent to another program that expects all this data to be concatenated. From what you can read here, the best way to concatenate appears to be dumping the data into a list and then doing <code>''.join(lst)</code> but it appears to me that creating might incur a memory overhead .</p>
  
  <p>Is there any way to enjoy the benefits of <code>''.join(lst)</code> without creating a long list?</p>
  
  <p>It is not hard to approximate how big the complete string is going to be. Is there a way to allocate that space and just pour the data inside? For instance with something like numpy? Then convert it into a huge string?</p>