Any comments? My draft of a new PEP.
jeff at ccvcorp.com
Sat Aug 18 00:35:57 CEST 2001
> ... but suppose that the new division semantics
> were to be implemented on the keyword "div" and that keyword had been
> reserved? I personally continue to believe (STRONGLY!) that new division
> semantics should be introduced in this way, in particular because of
> synergy with the current divmod() function.This would make it so that those
> who want even integer division semantics could get what they want while
> at the same time ensuring that all old code continues to work as it used to.
> [and imo, this "some new programmers are confused by floating point
> division" meme isn't something we should be attempting to solve].
>sigh< The idea that div-semantics are changing for the sake of new programmers
(or any other special sub-group) is a red herring, as has been pointed out many
New-div semantics are necessary for numeric integration. Judging from what
Guido has said, this is the core reason for the change, whatever else the rest
of the newsgroup may be bleating about. Numeric integration is a good thing.
Old-div semantics prevent numeric integration. Ergo, div semantics must be
changed. This also means that it is *not* practical for new semantics to use
any spelling other than / because that *will* be the normally used version.
New-div is *not* for people with special needs, it is for simplification of the
overall numeric architecture, and as such, it *must* be the default. Yeah, it's
frightening that it will break a lot of code, and I used to be opposed to it for
that very reason. But I can see that it's necessary for the direction that
Python is trying to go in, and as such, the sooner it's done the better. And
really, let's be honest--when was the last time that VC++ upgraded a version
without breaking any old code? How much perl4 code can you run under perl5?
Python is doing far more to make the transition smoother than almost any other
More information about the Python-list