Message257754
FWIW a long time ago I wanted fast XORing of 512-byte “sectors” of Rar files. Initially I think I used array.array with the largest word size available, or numpy if available. Later when I learnt more Python I discovered the int.from_bytes() trick, and used int(hexlify(...), 16) in Python 2. So I guess the array module was a relatively obvious place to look, and the long integer trick was unexpected (I’d never programmed with unlimited size integers before).
Serhiy’s bit array idea also seems interesting. I bet somebody has already written a package. Maybe it could also be useful for things like Huffman encoding, where you string various bit strings together into a sequence of bytes. But I do wonder if all these things are too specialized for Python’s standard library. |
|
Date |
User |
Action |
Args |
2016-01-08 12:15:14 | martin.panter | set | recipients:
+ martin.panter, gvanrossum, georg.brandl, rhettinger, terry.reedy, pitrou, vstinner, christian.heimes, Ramchandra Apte, serhiy.storchaka, abarnert, josh.r |
2016-01-08 12:15:14 | martin.panter | set | messageid: <1452255314.4.0.176041387593.issue19251@psf.upfronthosting.co.za> |
2016-01-08 12:15:14 | martin.panter | link | issue19251 messages |
2016-01-08 12:15:13 | martin.panter | create | |
|