[Python-ideas] Bitwise operations on bytes class
Antoine Pitrou
antoine at python.org
Mon Jun 16 22:38:00 CEST 2014
There's a bitstring package on PyPI, perhaps it has the desired operations:
https://pypi.python.org/pypi/bitstring/
Regards
Antoine.
Le 16/06/2014 16:28, Nathaniel McCallum a écrit :
> On Mon, 2014-06-16 at 13:21 -0700, Guido van Rossum wrote:
>> As additional input to thsi discussion I would like to remind you all
>> that it's not a good idea to have every operator apply to every data
>> type, as this increases the chances that bugs percolate up to a point
>> where it's hard to figure out where an unexpected value was generated.
>> IOW, just because there's no current meaning for e.g. b^b, that
>> doesn't necessarily make it a good idea to add one. (There are other
>> arguments from language usability against adding new operations
>> indiscriminately, but this in particular jumped out at me.)
>
> Agreed. My only thought here was that this addition seems to me to be
> extremely natural and emulates the precise grammar that is very often
> seen in algorithms in IETF RFCs (for instance). But the precise
> threshold of "too many operators" can be difficult to gauge. That is
> probably above my pay grade. :)
>
> Nathaniel
>
>
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
>
More information about the Python-ideas
mailing list