[Numpy-discussion] ?
Mark Jackson
mjackson at wc.eso.mc.xerox.com
Thu Oct 26 09:54:30 EDT 2000
Konrad Hinsen <hinsen at cnrs-orleans.fr> writes:
> boncelet at udel.edu@SMTP at python.org writes:
> > But (donning my contrarian hat), while appealing to newcomers
> > is a laudable goal, Python will die if it does not appeal to serious
> > programmers writing serious code. The CS world is littered with
> > dead teaching languages (anyone remember PLC?). IMHO, the
> > right question to ask is "what do serious programmers want?"
>
> Making the bold claim to be a serious programmer, I'd say they want to
> be able to specify either integer or float division, but they don't
> care about the precise syntax, as long as both are straightforward to
> do.
Absolutely. I come from a Fortran background and have no trouble at
all with 3/2 yielding 1. The problem is that code seldom looks like
this:
a = 3/2
Instead it looks like this:
a = b/c
and I have yet to find an algorithm for which "b/c yields integer if b
and c are both integers, else float" is actually appropriate behavior!
Particularly in my usual application domain (Python as an interactive
steering and scripting language for Fortran and C modules) preventing
inadvertent arrival of integers at such expressions is a major PITA.
Give us div, or (better) //, for integer division. The purists can
then overload it for their class-of-rationals.
--
Mark Jackson - http://www.alumni.caltech.edu/~mjackson
I respect faith, but doubt is what gets you an education.
- Wilson Mizner
More information about the Python-list
mailing list