Comment on PEP-0238
Roman Suzi
rnd at onego.ru
Fri Jul 6 09:55:03 EDT 2001
On Fri, 6 Jul 2001, Guido van Rossum wrote:
> "Robert J. Harrison" <rjh at 3-cities.com> writes:
> > Again, my major objection to this proposal is that it gives us
> > nothing and breaks a lot of existing code.
>
> Other educators disagree. Take the case of VPython.
> """
> Everything worked extremely well except for integer division, both 1/2
> being zero and 10**-15 giving an execution error. For example, on last
> week's program one student spent two hours trying to figure out why he
> was getting a strange positron trajectory, and it finally turned out
> to be (x+y)**(1/2), which looks fine but is equal to 1 for all values
> of x and y.
> """
>
> > integers makes programming easier to learn for beginners, but this
> > is absolutely not consistent with my experience in teaching
> > programming using Python and other languages (including Maple that
> > has rationals).
> Note that I'm not saying that 1/2 *returns* 0.5. While in the current
> proposal that's indeed the plan, I'm not necessarily against returning
> something else, e.g. maybe a rational. (I have a different reason to
> dislike rationals and favor decimal arithmetic instead, but that's
> quite a different discussion.) I'm just saying that the *value* of
> 1/2 should be equal to the value of 0.5, in other words, 1/2 should
> act like 0.5 when fed into a floating point expression
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?
Sincerely yours, Roman A.Suzi
--
- Petrozavodsk - Karelia - Russia - mailto:rnd at onego.ru -
More information about the Python-list
mailing list