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 pitrou
Recipients Ramchandra Apte, christian.heimes, georg.brandl, gvanrossum, josh.r, martin.panter, pitrou, rhettinger, serhiy.storchaka, terry.reedy, vstinner
Date 2016-01-08.00:19:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1452212393.98.0.0712375085545.issue19251@psf.upfronthosting.co.za>
In-reply-to
Content
Another possibility if you don't mind a copy is to use int.from_bytes():

>>> p = int.from_bytes(a, 'little')
>>> q = int.from_bytes(b, 'little')
>>> (p ^ q).to_bytes(len(a), 'little')
b'qPP'
History
Date User Action Args
2016-01-08 00:19:54pitrousetrecipients: + pitrou, gvanrossum, georg.brandl, rhettinger, terry.reedy, vstinner, christian.heimes, Ramchandra Apte, martin.panter, serhiy.storchaka, josh.r
2016-01-08 00:19:53pitrousetmessageid: <1452212393.98.0.0712375085545.issue19251@psf.upfronthosting.co.za>
2016-01-08 00:19:53pitroulinkissue19251 messages
2016-01-08 00:19:53pitroucreate