[Python-Dev] Integer division transition

Greg Wilson gvwilson@nevex.com
Tue, 7 Nov 2000 11:41:25 -0500

>  > Guido van Rossum:
>  > > No, we *could* use the 'import as' trick: define the syntax as
>  > > term: factor (('*'|'/'|'%'|NAME) factor)*
>  > > and add a check that NAME is "div" in the compiler.

> Charles G. Waldman:
> And what is the compelling reason for going through all this instead
> of just using the '//' symbol?  Because it might be confused for a C++
> comment?  This is a weak argument AFAIAC.  Python is not C++ and
> everybody knows that.
> Long before the creation of python-dev, this issue had been discussed
> numerous times on c.l.py, and the '//' operator was suggested several
> times, and I don't think anybody ever had a problem with it...

Greg Wilson:
As someone who teaches Python, I'm strongly opposed to using '//' in the
same language as '/', purely on readability grounds:

1. Every C/C++ book includes a warning about "=" vs. "==", because it's
   a common hard-to-spot error.

2. What mark would you give a student who had variables IO and I0 in the
   same module?


p.s. I was very disappointed to discover that Ruby uses both '..' and '...'
One means "up to but not including", the other means "up to and including".
It would be interesting to estimate the number of programmer-hours this will
cost... :-)