title: Prepending bytearray: TypeError: an integer is required
body: <p>I have two <code>bytearray</code>s:</p>
  
  <pre><code>ba1 = bytearray(b'abcdefg')
  ba2 = bytearray(b'X')
  </code></pre>
  
  <p>How can I insert ("prepend") <code>ba2</code> in <code>ba1</code>?</p>
  
  <p>I tried to do:</p>
  
  <pre><code>ba1.insert(0, ba2)
  </code></pre>
  
  <p>But this doesn't seem to be correct.</p>
  
  <p>Of course I could do following:</p>
  
  <pre><code>ba2.extend(ba1)
  ba1 = ba2
  </code></pre>
  
  <p>But what if <code>ba1</code> is very big?
  Would this mean unnecessary coping of the whole <code>ba1</code>?
  Is this memory-efficient?</p>
  
  <p>How can I prepend a <code>bytearray</code>?</p>