[Visualpython-users] New Windows VPython
bas at andrew.cmu.edu
Tue Dec 25 07:13:57 CET 2001
I'm not sure how to say it any more plainly than I've already said it, but
I'll try once more.
NOTHING has changed in VPython that forces you to use the new division
What has changed is that you MAY if you wish use the new division
operators, even if you use Numeric arrays. The problem was that Numeric
didn't recognize and process the new "true division" and "floor division"
operators present in Python 2.2. There is no "fork" of Numeric. I've
submitted the additions for inclusion in the next release of Numeric and
been thanked for doing the work and told that many people were asking for
But if you don't want to use the new division operators, DON'T put "from
__future__ import division" in your programs! Including when you're using
As to the student issue: There is no theorizing nor condescension in this.
The actual data are that very smart college freshmen with very high SAT's
etc., but who often have never written a computer program before,
frequently make the "mistake" of writing such things as 1/2 thinking that
this means the same as 0.5, because that's what it means in all other
environments, including their pocket calculator. And they and their
instructors find it difficult to track down why the program fails, because
the difference between 1/2 and 1./2 is awfully subtle and hard to pick up
in proofreading. I have a Ph.D. in physics, done a lot of system software
work including creating a respectable programming language (cT), and I make
this "mistake" too when doing scientific programming. I repeat that this is
about the only significant problem our students have had with Python. Can
you present data that our students don't have a serious problem with this
issue? Remember too that this is in the context of a physics class, not a
computer science class, and we can't afford to spend time on teaching picky
details of syntax.
Until now there was nothing we could do about this. We did not want to do
what the Alice project did, which was hack Python to fix the problem,
because this would be a "fork" and make our Python different from the world
Python. Now with Python 2.2 we can teach our students to insert "from
__future__ import division". And we can try to teach students that when a
program fails, they should check to make sure that they've inserted this
It is at least a reasonable question whether to drive Python or VPython
with the "-Qnew" command-line option which has the same effect as the
import statement. On balance, we think we shouldn't make this the default
run mode in our local classroom VPython environment, because our students
may well run Python and/or VPython in environments other than our classroom.
I will attempt to say nothing more about any of this.
--On Monday, December 24, 2001 21:14 -0500 Arthur Siegel
<ajs at ix.netcom.com> wrote:
>> You've jumped the gun, but your input is useful nevertheless.
> I'm not sure how. I am reading your message to say that the copy
> of Numeric that is downloaded with VPython has been patched.
> And since I am directing users of PyGeo to VPython, I am directing
> them to a forked version of Numeric. Which is somehow horrid to me.
> What am I missing.
> As to the rest - I should probably keep my peace.
> I've pissed off enough people and caused myself enough
> grief in the course of it.
> But is all quite, quite incredible to me.
> I think the importance you attach to this issue is monumentally
> overstated, and overwhelmingly condescending.
> Now you are further saying that your students can't even be
> trusted to be able to handle the from __future__ statement
> all my their little bitty selves.
> Suffice it to say that am I sure the hell glad I'm not in
> school anymore.
More information about the Python-list