On Thu, Jul 8, 2010 at 3:18 AM, Rani Hod <[email protected]> wrote: >> I wouldn't like the trade-off where you "win" a couple of >> questions on mailing-lists and pay for it with the DRY in >> >> complex_or_just_long_reference = complex_or_just_long_reference + 1 >> > > But wouldn't you prefer something like > complex_or_just_long_reference = same + 1 > which turns out to be more powerful than the standard pack of syntactic > sugar constructs: > complex_or_just_long_reference = max(same, new_thing) > or > complex_or_just_long_reference = "(" + same + ")" > IMHO, this is more readable and saves most of the mess with long names.
It took me a while to understand that same is a keyword here. What about complex_or_just_long_reference = complex_or_just_long_reference.max(new_thing) or, the same way as you do it for + writing something like this: complex_or_just_long_reference .= max(new_thing) Gabor _______________________________________________ Python-il mailing list [email protected] http://hamakor.org.il/cgi-bin/mailman/listinfo/python-il
