PATCH: Augmented assignment
Moshe Zadka
moshez at math.huji.ac.il
Sat Jun 10 16:28:06 EDT 2000
On Sat, 10 Jun 2000, Christian Tanzer wrote:
> 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.
Anyone doing *that* isn't familiar with the pydiom:
s, i = nested_strucre[some_index], another_index
s[i] = s[i] + 1
--
Moshe Zadka <moshez at math.huji.ac.il>
http://www.oreilly.com/news/prescod_0300.html
http://www.linux.org.il -- we put the penguin in .com
More information about the Python-list
mailing list