[Python-3000] bytes vs array.array vs numpy.array

2007-10-15 Thread Colin J. Williams
[EMAIL PROTECTED] wrote: > Nick> I wouldn't mind seeing some iteration-in-C bit-bashing operations > Nick> in there eventually... > > Nick>data = bytes([x & 0x1F for x in orig_data]) > > This begins to make it look what you want is array.array or nump.array. > Python's arrays don't

Re: [Python-3000] bytes vs. array.array vs. numpy.array

2007-10-01 Thread Greg Ewing
Nick Coghlan wrote: > numpy would be a big dependency to bring in just to > get more efficient bit-oriented operations on a byte sequence Random thought - if long integers were to use byte sequences internally to hold their data, it might be possible to get this more or less for free in terms of

Re: [Python-3000] bytes vs. array.array vs. numpy.array

2007-10-01 Thread Nick Coghlan
[EMAIL PROTECTED] wrote: > Nick> I wouldn't mind seeing some iteration-in-C bit-bashing operations > Nick> in there eventually... > > Nick>data = bytes([x & 0x1F for x in orig_data]) > > This begins to make it look what you want is array.array or nump.array. > Python's arrays don'

[Python-3000] bytes vs. array.array vs. numpy.array

2007-10-01 Thread skip
Nick> I wouldn't mind seeing some iteration-in-C bit-bashing operations Nick> in there eventually... Nick>data = bytes([x & 0x1F for x in orig_data]) This begins to make it look what you want is array.array or nump.array. Python's arrays don't support bitwise operations either, b