why no ++?

Marcin 'Qrczak' Kowalczyk qrczak at knm.org.pl
Tue Aug 14 18:15:22 EDT 2001


Tue, 14 Aug 2001 23:03:28 +0200, Alex Martelli <aleaxit at yahoo.com> pisze:

>> > How would you like to rewrite _this_?-)  There is *NO* rewrite
>> > that ensures constant semantics except by introducing _another_
>> > temporary variable -- *yecch*!-)
>>
>> y.a, (b,c,d), x.e = [wower()] * 3
> 
> Neat!  OK, mysentence += "or nested-tuple-unpacking (dbl yech!-)"

I'm not sure if it should be considered introducing a temporary
variable (it doesn't add a name to the current scope), but here it is:

y.a, b, c, d, x.e = \
  (lambda z: (lambda z1, z2, z3: (z, z1, z2, z3, z))(*z))(wower())

-- 
 __("<  Marcin Kowalczyk * qrczak at knm.org.pl http://qrczak.ids.net.pl/
 \__/
  ^^                      SYGNATURA ZASTĘPCZA
QRCZAK



More information about the Python-list mailing list