Discussion: new operators for numerical computation

Neel Krishnaswami neelk at brick.cswv.com
Sun Jul 23 09:29:00 EDT 2000


Paul Prescod <paul at prescod.net> wrote:
> Neel Krishnaswami wrote:
> > 
> > My proposal would be to replace it with encapsulated multimethods,
> > because that's the best way of solving the binary method problem in an
> > OO language. 
> 
> Neel, I think you have projected your own wishes onto that of the matrix
> people! 

It's entirely possible, because I am generalizing from my own
experience. I am drawing on the problems I ran into when I tried to
extend the Numeric package in a way that "looked matrix-y".

> They specifically *asked for new syntax*. They are perfectly happy
> with Python's semantics. They just think it doesn't look matrix-y
> enough. (which it doesn't)

The people who want to iterate over a file without slorping the whole
thing into memory also often ask for new syntax along the lines of:

  file = open("foo.txt")
  while x := file.readline():
     do_stuff(x)

I think it's reasonable to look at a request to try to figure out what
the underlying need is: "Hmm, they want to iterate over a file
lazily. Perhaps a method returning a lazy reader should be added to
FileObject, and the iteration protocol cleaned up to make this easier
to do?"


Neel



More information about the Python-list mailing list