PATCH: Augmented assignment

Christian Tanzer tanzer at swing.co.at
Sat Jun 10 14:36:56 EDT 2000


invalid.address at 127.0.0.1 (David) wrote:

> On Fri, 9 Jun 2000 16:39:38 +0200, Thomas Wouters <thomas at xs4all.net>
> wrote:
> 
> >As promised, here is my patch to add augmented assignment (+=, -= and
> >family) to Python. It's still Work In Progress, and probably requires a
> >rewrite of some magnitude before Guido will accept it.
> 
> 
> Why would the Python community want this?  It obfuscates code, in as much
> that newbies aren't likely to intuite what the symbols mean.
>
[snip]
>
> And it's not like it adds new functionality nor improves code readibility.
> It just saves the lazy programmer a whopping one or two keystrokes.

It doesn't obfuscate code looking like:

   nested_structure [some_index] [another_index] = nested_structure [some_index] [another_index] + 1

And it saves more than a few keystrokes.

-- 
Christian Tanzer                                         tanzer at swing.co.at
Glasauergasse 32                                       Tel: +43 1 876 62 36
A-1130 Vienna, Austria                                 Fax: +43 1 877 66 92





More information about the Python-list mailing list