PEP0238 lament

Grant Edwards grante at
Mon Jul 23 20:45:12 CEST 2001

In article < at qrnik.zagroda>, Marcin 'Qrczak' Kowalczyk wrote:

>The difference between '+' and '/' is that ints aren't
>implicitly converted to strings, so one wouldn't use an int
>instead of a string expecting '+' to do the conversion and
>concatenation. But ints *are* implicitly converted to floats
>when needed

Language design mistake.

>in about all contexts except '/', so it would be reasonable to
>expect them to be converted in the '/' case too.

And we'll fix it by makeing more widespread.

>Python does treat ints and floats as different parts of the
>same concept by letting them compare equal and convert as

Let's change that.  Mixing ints and floats should to
automagical conversion, it should cause an exception.  That's
no more disruptive that changing the meaning of the "/"
operator, and it's far more in line with the spirit of not
converting operands to make operators happy.

>So real division and integer division should be distinguished
>by the operator.

That's one opinion.  I feel that in an OO language the objects
should determine the meaning of the operators.

Grant Edwards                   grante             Yow!  Yes, but will I
                                  at               see the EASTER BUNNY in
                                 skintight leather at an
                                                   IRON MAIDEN concert?

More information about the Python-list mailing list