PEP 238 (revised)

Paul Svensson paul at svensson.org
Fri Jul 27 10:04:00 EDT 2001


Guido van Rossum <guido at python.org> writes:

>    The names associated with these variations are:
>
>    - Overloaded operator methods:
>
>      __div__(), __floordiv__(), __truediv__();
>
>      __idiv__(), __ifloordiv__(), __itruediv__().

Do we really neead to add __truediv__ and __itruediv__ ?
As far as I can see, the only reason for these would be to let
someone writing their own numeric class explicitly differentiate
between classic division and future division.
Are there really such classes out there that need to be catered to ?
If not, I'd suggest letting __div__ and __idiv__ handle both.

Other than that, I really don't like the term 'true division',
I'm not sure exactly why, but it just doesn't ring...

I liked the proposal to call '/' division, and '//' quotient;
ambiguities can be resolved by using 'classic division' or 'future division'.

	/Paul




More information about the Python-list mailing list