Re: User-defined augmented assignment

2005-10-01 Thread Tom Anderson
On Thu, 29 Sep 2005, Pierre Barbier de Reuille wrote: > a discussion began on python-dev about this. It began by a bug report, > but is shifted and it now belongs to this discussion group. > > The problem I find with augmented assignment is it's too complex, it's > badly explained, it's error-pro

Re: User-defined augmented assignment

2005-09-29 Thread Paddy
I thought along these lines: It is an augmented ASSIGNMENT. (It even has an equals sign in it). tuples are immutable so you should not be able to assign to one of its elements. - So there is no problem for me - I shouldn't be messing with an element of an immutable type! - Cheers, Paddy. --

Re: User-defined augmented assignment

2005-09-29 Thread Pierre Barbier de Reuille
Reinhold Birkenfeld a écrit : > Pierre Barbier de Reuille wrote: > > >>So, what I would suggest is to drop the user-defined augmented >>assignment and to ensure this equivalence : >> >>a X= b <=> a = a X b >> >>with 'X' begin one of the operators. > > > It can be done, but it's unnecessary for

Re: User-defined augmented assignment

2005-09-29 Thread Reinhold Birkenfeld
Pierre Barbier de Reuille wrote: > So, what I would suggest is to drop the user-defined augmented > assignment and to ensure this equivalence : > > a X= b <=> a = a X b > > with 'X' begin one of the operators. It can be done, but it's unnecessary for mutable objects like sets or lists. A new ob