Re: Overloading assignment operator

2007-01-29 Thread Michael Spencer
J. Clifford Dyer wrote: > I think that's the first time I've actually seen someone use a Monty > Python theme for a python example, and I must say, I like it. However, > "We are all out of Wensleydale." > > Cheers, > Cliff Oh, then you clearly don't waste nearly enough time on this newsgroup ;

Re: Overloading assignment operator

2007-01-29 Thread J. Clifford Dyer
Steven D'Aprano wrote: > On Tue, 23 Jan 2007 18:07:55 -0800, Russ wrote: > >> Achim Domma wrote: >>> Hi, >>> >>> I want to use Python to script some formulas in my application. The user >>> should be able to write something like >>> >>> A = B * C >>> >>> where A,B,C are instances of some wrapper c

RE: Overloading assignment operator

2007-01-25 Thread Carroll, Barry
> -Original Message- > From: Gabriel Genellina [mailto:[EMAIL PROTECTED] > Sent: Tuesday, January 23, 2007 9:24 PM > To: python-list@python.org > Subject: Re: Overloading assignment operator > > "Carroll, Barry" <[EMAIL PROTECTED]> escribió

Re: Overloading assignment operator

2007-01-24 Thread John Pye
Hi thre, On Jan 24, 5:24 am, Achim Domma <[EMAIL PROTECTED]> wrote: > I want to use Python to script some formulas in my application. Depending on what you're trying to do, you might possibly find it useful to lake a look at the approach used by PyGINAC, which is a symbolic algebra system (in C++

Re: Overloading assignment operator

2007-01-23 Thread Steven D'Aprano
On Tue, 23 Jan 2007 18:07:55 -0800, Russ wrote: > Achim Domma wrote: >> Hi, >> >> I want to use Python to script some formulas in my application. The user >> should be able to write something like >> >> A = B * C >> >> where A,B,C are instances of some wrapper classes. Overloading * is no >> probl

Re: Overloading assignment operator

2007-01-23 Thread Gabriel Genellina
"Carroll, Barry" <[EMAIL PROTECTED]> escribió en el mensaje news:[EMAIL PROTECTED] > * ... the assignment operator is used to assign an > * object to a name in the current namespace... IOW, you cannot "overload > * the assignment operator." > (wesley chun) This is the key concept, if you want to

Re: Overloading assignment operator

2007-01-23 Thread Russ
Achim Domma wrote: > Hi, > > I want to use Python to script some formulas in my application. The user > should be able to write something like > > A = B * C > > where A,B,C are instances of some wrapper classes. Overloading * is no > problem but I cannot overload the assignment of A. I understand t

RE: Overloading assignment operator

2007-01-23 Thread Carroll, Barry
> -Original Message- > From: Achim Domma [mailto:[EMAIL PROTECTED] > Sent: Tuesday, January 23, 2007 10:25 AM > To: python-list@python.org > Subject: Overloading assignment operator > > Hi, > > I want to use Python to script some formulas in my application. The user > should be able to wr

Re: Overloading assignment operator

2007-01-23 Thread Peter Otten
Steven D'Aprano wrote: > On Tue, 23 Jan 2007 19:42:01 +0100, Peter Otten wrote: > >> Achim Domma wrote: >> >>> I want to use Python to script some formulas in my application. The user >>> should be able to write something like >>> >>> A = B * C >>> >>> where A,B,C are instances of some wrapper

Re: Overloading assignment operator

2007-01-23 Thread Achim Domma
Paul McGuire wrote: > Simple option: how do you feel about using '<<=' instead of '=' (by > defining __ilshift__)? This gives you: > > A <<= B * C > > (looks sort of like "injecting" the result of B times C into A) Thanks! That is exactly the kind of solution I was looking for! :-) Achim --

Re: Overloading assignment operator

2007-01-23 Thread Steven D'Aprano
On Tue, 23 Jan 2007 19:42:01 +0100, Peter Otten wrote: > Achim Domma wrote: > >> I want to use Python to script some formulas in my application. The user >> should be able to write something like >> >> A = B * C >> >> where A,B,C are instances of some wrapper classes. Overloading * is no >> pro

Re: Overloading assignment operator

2007-01-23 Thread Kay Schluehr
Achim Domma schrieb: > Hi, > > I want to use Python to script some formulas in my application. The user > should be able to write something like > > A = B * C > > where A,B,C are instances of some wrapper classes. Overloading * is no > problem but I cannot overload the assignment of A. I understa

Re: Overloading assignment operator

2007-01-23 Thread Erik Max Francis
Achim Domma wrote: > I want to use Python to script some formulas in my application. The user > should be able to write something like > > A = B * C > > where A,B,C are instances of some wrapper classes. Overloading * is no > problem but I cannot overload the assignment of A. I understand that

Re: Overloading assignment operator

2007-01-23 Thread Paul McGuire
On Jan 23, 12:24 pm, Achim Domma <[EMAIL PROTECTED]> wrote: > Hi, > > I want to use Python to script some formulas in my application. The user > should be able to write something like > > A = B * C > > where A,B,C are instances of some wrapper classes. Overloading * is no > problem but I cannot ove

Re: Overloading assignment operator

2007-01-23 Thread Peter Otten
Achim Domma wrote: > I want to use Python to script some formulas in my application. The user > should be able to write something like > > A = B * C > > where A,B,C are instances of some wrapper classes. Overloading * is no > problem but I cannot overload the assignment of A. I understand that >