Augmented Assignement (was: Re: PEP scepticism)

Carlos Ribeiro cribeiro at mail.inet.com.br
Sat Jun 30 13:47:19 EDT 2001


As the current discussion about Augmented Assignment stands, I was 
wondering if it was not better to make it invalid to use augmented 
assignment on immutable types. After all it does not make much sense. If 
the value is immutable, what sense does it make to have it modified inplace?

The funny thing is that inplace addition is a nice way to express string 
concatenation, which is a immutable object... But it inconsistent and 
misleading ("what are saying? the object is immutable, but you can change 
it? is it immutable or not?").

Anyway, as it stands, that is little chance to make any change. The current 
behavior is already established, and any change can break existing code. 
Better pick another fight.


Carlos Ribeiro






More information about the Python-list mailing list