proposed language change to int/int==float (was: PEP0238 lament)

Tim Hochberg tim.hochberg at ieee.org
Fri Jul 27 10:11:19 EDT 2001


"Guido van Rossum" <guido at python.org> :
> "Terry Reedy" <tjreedy at home.com> writes:
>
> > If I write def(seq, n, k): return seq[3*n//k] and a call receives
> > n=20.0 instead of 20, it would accord with the polymorphic rationale
> > for new / and // to go ahead and return the item intended.  Or perhaps
> > floored numbers should be marked as exact (if the marking is
> > independent of type).
>
> Good point.  What does Scheme do?


Floor, ceiling, truncate and round all return integers. It seems that it
wouldn't really be possible to have // do that consistently without PEP 237
though.

-tim





More information about the Python-list mailing list