Ka-Ping Yee <[EMAIL PROTECTED]> wrote > On 3/4/07, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > > FWIW, I would like the feature to be kept. I've found it useful in that it > > documents the function signature more completely when dealing > > with arguments that are already pre-packed into tuples > > I just noticed that this has a more noticeable effect on lambda, since > you don't have room for another statement to do the unpacking. > > To sort a dictionary by value, you can currently write > > sorted(dict.items(), key=lambda (key, value): value) > > Without tuple unpacking, this idiom becomes > > sorted(dict.items(), key=lambda item: item[1]) > > obscuring the fact that the item is a (key, value) pair.
Oooops. I'd pretty much ignored the discussion because I thought that I didn't use tuple parameter unpacking anyway. Unfortunately, I use it quite a bit with lambda. I shudder at the thought how those are going to look without tuple unpacking. FWIW, I always liked the `parameter passing is assignment` semantics of Python. I sure hope nobody is going to start a crus^H^H^H^HPEP to remove tuple unpacking in general from the language! -- Christian Tanzer http://www.c-tanzer.at/ _______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com