[Python-3000] Last call for PEP 3137: Immutable Bytes and Mutable Buffer

Terry Reedy tjreedy at udel.edu
Tue Oct 2 05:59:12 CEST 2007


"Nick Coghlan" <ncoghlan at gmail.com> wrote in message 
news:4700FC40.1060206 at gmail.com...
| Brett Cannon wrote:
| > +1 from me.
|
| Looks good to me too: +1
|
| I wouldn't mind seeing some iteration-in-C bit-bashing operations in
| there eventually, but they aren't needed on the first pass, and even
| being able to do things like the following will be a decent improvement
| over the status quo for low-level bitstream manipulation:
|
|   data = bytes([x & 0x1F for x in orig_data])

If orig_data were mutable (the new buffer, as proposed in the PEP), would 
not

for i in range(len(orig_data)):
  orig_data[i] &= 0x1F

do it in place? (I don't have .0a1 to try on the current bytes.)

tjr





More information about the Python-3000 mailing list