[Edu-sig] PEP 238 - non-integer division

Kirby Urner pdx4d@teleport.com
Thu, 26 Jul 2001 11:59:33 -0700


At 11:38 AM 7/26/2001 -0700, Brent Burley wrote:
>Sorry for jumping in so late.  I'd like to argue in opposition to 238.


Yes, your points are being represented vociferously on
comp.lang.python.

The thing about / is it's exceptional in mathematics itself.
*, + and - are closed for integers, but / takes you out
into the rationals (as per how these keys work on any
calculator -- except we use floats).

a/b will be essentially equivalent to float(a)/b

a//b will be divmod(a,b)[0]

It's true that code will break, but you have the option
to specify which version of Python you app needs.  If
the app is being actively maintained, then you can keep
abreast the latest version.

My understanding is the change will be finalized in
3.x, which was slated to be not-so-backward-compatible
in any case.

Kirby