title: Remove first n elements of bytes object without copying
body: <p>I want to remove elements of a <code>bytes</code> parameter in a function. I want the parameter to be changed, not return a new object.</p>
  
  <pre><code>def f(b: bytes):
    b.pop(0)   # does not work on bytes
    del b[0]   # deleting not supported by _bytes_
    b = b[1:]  # creates a copy of b and saves it as a local variable
    io.BytesIO(b).read(1)  # same as b[1:]
  </code></pre>
  
  <p>What's the solution here?</p>