This post originated from an RSS feed registered with Python Buzz
by Dmitry Dvoinikov.
Original Post: Approaching Python 3000: no more automatic tuple parameter unpacking
Feed Title: Things That Require Further Thinking
Feed URL: http://feeds.feedburner.com/ThingsThatRequireFurtherThinking
Feed Description: Once your species has evolved language, and you have learned language, [...] and you have something to say, [...] it doesn't take much time, energy and effort to say it. The hard part of course is having something interesting to say.
-- Geoffrey Miller
is no longer possible in Python 3000. You are supposed to write
lambda x_y: x_y[0] + x_y[1]
instead. This also applies to functions, not just to lambdas and the idea belongs to PEP 3113 which forbids automatic tuple unpacking in function parameters. Ugly and inconvenient if you ask me, but there apparently was somebody who kept shooting himself in the leg.
I think that automatic unpacking was rather useful (if used sparingly), especially when you had to do something like
map(lambda (i, (a, b)): i * (a + b), enumerate(zip(aa, bb))