Deposing Dictators

Terry Reedy tjreedy at home.com
Sun Aug 5 13:49:07 EDT 2001


"Stephen Horne" <steve at lurking.demon.co.uk> wrote in message
news:56fqmtcl20tg64aradbnarkj9kl514kg67 at 4ax.com...

> >On Thu, 2 Aug 2001 00:32:56 +0100, Robin Becker wrote:
> >>No matter who decided what it seems clear that the decision to go
to /
> >>as float had already been taken long before the flamefest took
place.

As I summarized in article 'deja/vu', a thread in Nov. 1998 worked out
the essence of PEP0238: replace mixed / with frac / and floor //.
Included in that thread were the problems with mixed /, div(i,j), and
code breakage.

>On Wed, 01 Aug 2001 23:49:19 GMT, wtanksle at dolphin.openprojects.net
>(William Tanksley) wrote:
>>Nope; it makes it *other* than democratic.  The way you go on one
would
>>think that was a bad thing; actually, it's not.

> If there was an undeniably good reason for the change, I would agree
> with this. As it stands, there are equally good - if not better -
> reasons for keeping division as it is.

There *are* good reasons for the change.  (Undeniable?  Any reason, no
matter how good, can be denied by one who wishes to deny, so this
standard is too tough.)  That there are also good reasons for the
status quo does not negate this.

Summary of much of argument:

StatusQuo Viewpoint: Integers are algebraically distinct from
rationals/reals and all operations thereon should produce an integer.
/ is a convenient abbreviation for divmod[0].  (Counterpoint: // is
almost as convenient.)

Change Viewpoint: Ints are embedded subset of floats, included
separately for efficiency reasons.  Numerical expressions should give
numerically equivalent answers when fed numerically equivalent inputs.
(Do you really disagree that this is desirable?).  They do not now
when / is used (and thus current / is design mistake).  They will in
the future when either / or // is used.

StatusQuo Pragmatic: Change will break code.  (Counter: which is why a
long transition is planned.)

Change Pragmatic: Ambiguity of / (what is eight/three?) leads to
errors, *especially* in a language like Python with polymorphic
untyped names.   Change will enable other changes in numerics system.
(Counter: they might not be so hot either.)


> He [Guido] is a new-born division-must-be-done-this-way-ist.

How did you ever get *that* idea.  He mentioned wanting a change about
four years ago and described the exact proposed replacement nearly
three years ago.  (Again, see 'deja/vu').


Terry J. Reedy






More information about the Python-list mailing list