Getting rid of bitwise operators in Python 3?

Terry Reedy tjreedy at udel.edu
Sat Sep 22 16:23:42 EDT 2007


"Carl Banks" <pavlovevidence at gmail.com> wrote in message 
news:46f49740$0$32514$4c368faf at roadrunner.com...
| | Is it worth it to make such a change?  It would remove a lot of 
operators
| (11 by my count), vastly simplifying syntax,  Which, IMHO, is no small
| thing.  New numerical types would have fewer operations to support.

Py3 adds an abstract base class module.  Bit-integers (with the above 
operations) are a separate subclass of abstract int/rats (forget the 
detail), so new numerical types do not have to support those ops unless 
declared as deriving from the bit-int class.

Some people consider having lots of operators available to overload in 
their classes to be a good thing.  Operator notation is much nicer that 
function notation for binary functions.mapping pairs of objects of a class 
to an object of the class.

tjr






More information about the Python-list mailing list