On Fri, 22 Feb 2008 11:00:17 -0800, Aahz wrote:
> In article <[EMAIL PROTECTED]>, Bruno Desthuilliers
> <[EMAIL PROTECTED]> wrote:
>>
>>FWIW, it's IMHO a real wart - given Python's pretention at readability -
>>that augmented assignement has been implemented that way for lists.
>
> This was debated extensively when augmented assignment was created, and
> it was decided that practicality beat purity. It's just too convenient
> to be able to write
>
> L += ['foo']
>
> without rebinding L.
*scratches head*
Wouldn't L.append('foo') or L.extend(['foo']) be even more convenient,
and have perfectly obvious behaviour without leading to the confusion of
augmented assignments?
Personally, I think the confusion of augmented assignments is not worth
the benefit of saving typing a couple of characters. I think Guido's
first decision, to leave += etc out of the language, was the right
decision.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list