Comment on PEP-0238

Roman Suzi rnd at onego.ru
Fri Jul 6 16:35:52 EDT 2001


On Fri, 6 Jul 2001, Guido van Rossum wrote:

>Roman Suzi <rnd at onego.ru> writes:
>
>> This is reasonable. However, IMHO, solution need to be different
>> than redefining established "/" behaviour?
>>
>> Could "right" division be given some other symbol than "/" and old "/" be
>> left intact as a "low-level" C-conformant division every Python programmer
>> is accustomed to?
>
>Unfortunately, the number of potential Python programmers who will be
>frustrated by the current integer division is much larger than the
>number of established Python programmers.  The sooner we fix this the
>better!

Oh, yes...

>Another thing.  Division of integers is a pretty uncommon operation

May be... (I recall all my sins using /)

*

>The warning framework and the future statement are there to make the
>transition easier.  Here's my plan, "new division in four phases":
>
>1. First we introduce a new function div() and a future statement that
>2. In a following revision, we add a warning when / is used on two int
>3. A revision later, we change all plain integer divisions to be an
>4. Finally we can implement the "future" behavior by default.

I wish, there were also

from __past__ import old_lovely_integer_division
from __past__ import old_xrange
from __past__ improt old_non_nested_scopes

and whatever was dropped.

;-)

>I haven't picked dates yet; if folks agree, I would like to add div()
>and a future statement to 2.2 and space the other steps a single
>revision apart, so phase 4 would be at Python 2.5 (April 2003, if we
>keep the current release schedule up).  Is that too aggressive?

It is not agressive at all...
When we will have ANSI Python or ISO Python?;-)

>I currently favor div(x, y) over x//y and x div y.  Maybe also add
>mod(x, y) for symmetry (that would also explain divmod() as a
>messenger from the future :-).
>
>I'm not sure how to spell the future statement.  Here are some
>choices:
>
>  from __future__ import float_division
>  from __future__ import real_division
>  from __future__ import new_division
>  from __future__ import division

true_division probably

Sincerely yours, Roman Suzi
-- 
_/ Russia _/ Karelia _/ Petrozavodsk _/ rnd at onego.ru _/
_/ Friday, July 06, 2001 _/ Powered by Linux RedHat 6.2 _/
_/ ""Stupid" is a boundless concept." _/





More information about the Python-list mailing list