Re: User-defined augmented assignment

2005-10-01 Thread Tom Anderson
y confusing, as the two "a" are not necessarily the > same. Indeed. I certainly didn't realise that was how it worked. > 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 >

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 th

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 mu

User-defined augmented assignment

2005-09-29 Thread Pierre Barbier de Reuille
b[0] += [2] # Ok, no pb >>> print a [1,2] >>> c[0] += [3] Traceback (most recent call last): File "", line 1, in ? TypeError: object doesn't support item assignment >>> print a [1,2,3] Then, in the standard library, there is no use-case of user-defined