[Python-Dev] re: LANL syntax (assignment)

gvwilson@nevex.com gvwilson@nevex.com
Thu, 3 Feb 2000 19:16:00 -0500 (EST)


> > Greg Wilson wrote:
> > It'll make a big difference to NumPy (avoiding temporaries, etc.).  Also
> > hard to explain why you can redefine assignment to an array element, but
> > not to a scalar variable.

> David Ascher wrote:
> FWIW, I never got that question by my students.  I did get that
> question in a consulting context, but it was a very advanced problem
> having to do with needing control over references to huge external
> objects, etc.
> 
> Anyway, it's possible that your students are just too smart for their
> own good, Greg. =)

I wish I could tell from my notes whether the ones asking to redefine
assignment had C++ in their background or not.  Setting the consistency
issue aside, libraries like NumPy (and the Python futures package I keep
meaning to write) will be a lot cleaner from a user's point of view if
assignment is redefinable.  However, I do understand that there's no easy
way to do it without taking an unacceptable performance hit...  I'll send
anyone who can come up with a clean, workable solution a case of Canadian
beer (now how's *that* for a real prize? :-)

Greg