This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author martin.panter
Recipients Ramchandra Apte, abarnert, christian.heimes, georg.brandl, gvanrossum, josh.r, martin.panter, pitrou, rhettinger, serhiy.storchaka, terry.reedy, vstinner
Date 2016-01-08.12:15:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1452255314.4.0.176041387593.issue19251@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2016-01-08 12:15:14martin.pantersetrecipients: + martin.panter, gvanrossum, georg.brandl, rhettinger, terry.reedy, pitrou, vstinner, christian.heimes, Ramchandra Apte, serhiy.storchaka, abarnert, josh.r
2016-01-08 12:15:14martin.pantersetmessageid: <1452255314.4.0.176041387593.issue19251@psf.upfronthosting.co.za>
2016-01-08 12:15:14martin.panterlinkissue19251 messages
2016-01-08 12:15:13martin.pantercreate