Re: [Numpy-discussion] matrices and __radd__

2008-05-21 Thread Keith Goodman
On Wed, May 21, 2008 at 4:07 PM, Robert Kern <[EMAIL PROTECTED]> wrote: > On Wed, May 21, 2008 at 5:28 PM, Keith Goodman <[EMAIL PROTECTED]> wrote: >> I have a class that stores some of its data in a matrix. I can't >> figure out how to do right adds with a matrix. Here's a toy example: >> >> class

Re: [Numpy-discussion] matrices and __radd__

2008-05-21 Thread Robert Kern
On Wed, May 21, 2008 at 5:28 PM, Keith Goodman <[EMAIL PROTECTED]> wrote: > I have a class that stores some of its data in a matrix. I can't > figure out how to do right adds with a matrix. Here's a toy example: > > class Myclass(object): > >def __init__(self, x, a): >self.x = x # nump

[Numpy-discussion] matrices and __radd__

2008-05-21 Thread Keith Goodman
I have a class that stores some of its data in a matrix. I can't figure out how to do right adds with a matrix. Here's a toy example: class Myclass(object): def __init__(self, x, a): self.x = x # numpy matrix self.a = a # some attribute, say, an integer def __add__(self