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.

classification
Title: Bitwise operations for bytes-type
Type: enhancement Stage: resolved
Components: Interpreter Core Versions:
process
Status: closed Resolution: duplicate
Dependencies: Superseder: bitwise ops for bytes of equal length
View: 19251
Assigned To: Nosy List: MGilch, martin.panter, ncoghlan, r.david.murray
Priority: normal Keywords:

Created on 2017-10-01 15:01 by MGilch, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (4)
msg303464 - (view) Author: Matthias Gilch (MGilch) * Date: 2017-10-01 15:01
I've seen that the bytes type does not support bitwise operations, but I think users would expect that those operations will work.
msg303466 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2017-10-01 15:30
What happens when you apply a bitwise operation to two bytes objects of unequal length?

Since the answer to that question is not obvious, we simply don't support the operation.

If you want to make a proposal for this the python-ideas mailing list would be the appropriate forum.
msg303492 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2017-10-01 21:13
There’s already a bug open for this: Issue 19251. Only equal-length strings should be supported.
msg316932 - (view) Author: Nick Coghlan (ncoghlan) * (Python committer) Date: 2018-05-17 14:04
Issue 19251 is still under consideration, so marking this as a duplicate, rather than as rejected.
History
Date User Action Args
2022-04-11 14:58:53adminsetgithub: 75837
2018-05-17 14:04:38ncoghlansetnosy: + ncoghlan
messages: + msg316932
resolution: rejected -> duplicate

superseder: bitwise ops for bytes of equal length
2017-10-01 21:13:01martin.pantersetnosy: + martin.panter
messages: + msg303492
2017-10-01 15:30:51r.david.murraysetstatus: open -> closed

nosy: + r.david.murray
messages: + msg303466

resolution: rejected
stage: resolved
2017-10-01 15:01:16MGilchcreate