[Edu-sig] Re: PEP0238 lament

Kirby Urner pdx4d@teleport.com
Sun, 22 Jul 2001 11:20:27 -0700


I hadn't tuned in that PEP before, not being a Python guru
nor deeply involved in the elaboration of the language, and
so only an occasional visitor to the main Python newsgroup,
let alone its many subsidiaries.

In Arthur's defense, I'll say that in reading follow-up posts
to Guido's on the Python list, I saw several skeptics with
fairly cogent arguments.  In Guido's defense, I'll say that
none of these counter arguments seemed to personalize it to
such an extent.  In both Arthur's and Guido's defense, I'll
say that they're both aware of psychological dynamics and
are willing to talk about them in the open, even if smooth
cofunctioning is not yet in the picture (and may never be --
who's to know?).  In my own defense, I'll append that I
respect for both Guido and Arthur and thank them both for
enriching my life in various ways.

I find it somewhat ironic that Arthur has been extolling the
virtues of VPython to the extent of recommending it be
included as part of the Standard Library (which would drag
in Numeric as well), and that Guido sees this PEP as explicitly
making the Python-VPython relationship a more integrated/seamless
one -- and yet Arthur objects.  Hah hah.

Wearing my math teacher hat, I'll will add my two cents:

The / symbol is problematic in that the decimal expansion of
p/q is not necessarily terminal, and base 2 conversions make
floating point representations of 2/3 different from the
decimal expression we're taught in school.

Booting Python 2.1:

   >>> 2./3
   0.66666666666666663

There's a problem right there, for newbie/learner/newcomer
kids.  That's a different problem from 2/3 = 0, but it's still
a problem that needs to be addressed out in the open (I'm not
saying it isn't -- I'm exhorting teachers to understand the
difference between decimals as conveyed in math text books,
and the IEEE floating point specification, which is different).[1]

Booting DrScheme 103:

   > (/ 2 3)
   2/3
   > 2/3
   2/3

That's a different solution.  The rational type (vs. float)
is integrated into the language.  In Python, you need to import
a (non Standard Library) fraction class definition (e.g. Rat
in yarn.py) to accomplish this, by means of objects.  Scheme
also includes GCD as a primitive.  It's a different language.

My own view is that no language can be all things to all
people, so at some point you have to draw the line and say
"this is what you can do in X, and if that's too onerous,
given what you want to do, consider using Y instead --
don't expect X to be the best solution for every problem
you tackle".

Were I in charge, I might have preferred that / remain the
way it is, until/unless a more Scheme-like inclusion of
the rational number type (different from float) came along,
which would happen when the "long" type melted away, and
became part of "int" (seamless i.e. no difference from the
user's point of view).  This might have happened in 3.xx.
I think it's somewhat premature to fiddle with / in 2.x.

But I'm not in charge, and I can live with the change.
On the whole, I think Guido's aesthetic sense has been
excellent, and I give him very high grades.  On the basis
of this track record, I will defer to his judgement, all
cogent arguments to the contrary noted and appreciated.
In the meantime, I think I should exert greater effort
to learn both Scheme and Eiffel.  I'd also like to learn
OCaml while I'm at it.

Kirby