[Python-Dev] A future division proposal
Wed, 25 Jul 2001 16:53:45 +0100
> I don't know what the best name or symbol would be
> (olddiv, ///?) and admittedly it is ugly to have 3
> division operators. But the alternatives seem far,
> far uglier. Isn't this a case where practicality
> beats purity (for keywords or operators)?
You could probably write a function to do this. There's no need for anything
built into Python.
Actually, when I tried, I got into a bit of a mess getting the type checks
(which you need) right -
if type(n) == type(m) == type(0):
But this needs the checks expanded to take longs into account. Which is
where it gets messy.
a) It can be done, and
b) The fact that it's messy probably exposes what's wrong with the old
semantics quite well :-)