[Python-ideas] Bitwise operations on bytes class
Nathaniel McCallum
npmccallum at redhat.com
Mon Jun 16 22:28:00 CEST 2014
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
More information about the Python-ideas
mailing list