"Greg Ewing" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Baptiste Carvello wrote:
>
[Baptiste]
>> while manipulating binary data will happen mostly with bytes objects,
>> some
>> operations are better done with ints, like the bit manipulations with the
>> &|~^
>> operators.

[Greg]
> Why not just support bitwise operations directly
> on the bytes object?

Well, what's the result of

bytes([1,0,0])^ bytes([1,0])

?  Is it bytes([0,0,0]) (à la little-endian) or is it bytes([1,1,0])
(straight conversion to base-256)?  Or perhaps throw a ValueError if the 
sizes differ?

These details should be considered in the PEP.


_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to