PEP0238 lament

Paul Boddie paul at boddie.net
Mon Jul 23 05:18:29 EDT 2001


"Andy Salnikov" <salnikov at inp.nsk.su> wrote in message news:<9jg6ei$ges7$1 at sky.inp.nsk.su>...
> "Robin Becker" <robin at jessikat.fsnet.co.uk> wrote in message
> news:vyIKbWAP62W7EwC+ at jessikat.fsnet.co.uk...
> >
> > I think that is wrong, but I use python in a professional capacity. I
> > think languages succeed or fail because they work for programmers.
> 
> Yeah, completely agree. Personaly, if this change happens, it will be a big
> revolt from Python for me. Not only for aesthetic reasons, simply because I
> cannot rely on the language which dares to change the meaning of existing
> operators. What do you think will be next? Change assignment to work like a
> copy, because there are many people confused with the reference semantic?

Indeed. I think there's a significantly underestimated danger of
widespread code breakage in making such a fundamental change to the
language. While it may be disappointing to learn, or even consider,
that numerous working programs today may somehow depend on the
semantics of the / operator as it stands, we must still respect that
this situation exists.

Of course, it is also possible that some programs out there are
actually flawed because integer division is taking place where the
author intended that "floating point division" should occur, and where
arguments to the / operator were not anticipated to be, but can be,
integer. However, it is not up to the language architects to fix
people's programs for them - those programs were written according to
well-defined rules, and it is the obligation of the language
architects to maintain those rules.

> I almost hear how manager staff saying: "Do you talk about that sh**ty snake
> language which changes its rules every year? Don't even think about it in
> our project!"

I can see people seriously suggesting a "pythonfork" project if the
debate gets any more intense. :-O

> Guys, if you really need something returning floats for division, make it
> new operator, I guess everyone could be made happy with 1/2 == 0 and 1//2 ==
> 0.5.

The most sensible suggestion yet! I was reading the previous messages
in this thread waiting for someone to suggest this, and it's about
time someone did! There's a lot of weight behind adding a new
operator, yet most people seem to advocate adding the // operator and
then *changing* the / operator... which is madness!

If beginners want an operator which behaves as they expect, they
certainly aren't going to have any preconceptions about what it's
going to look like - they are beginners, after all. Therefore, why
even bother suggesting changing the / operator? Just introduce // and
be done with it! Nothing gets broken, the beginners get their new
operator, and those wanting the C++ comment syntax in Python will just
have to be disappointed. ;-)

Paul



More information about the Python-list mailing list