
Jan. 13, 2011
7:44 p.m.
On Thu, Jan 13, 2011 at 2:27 PM, Masklinn <masklinn@masklinn.net> wrote:
.. I don't see how it would be possible to replicate Python's breadth of arguments unpacking in return values.
What I do miss sometimes is the ability to inject the contents of a dictionary into locals. For example, when I get the results of a database query in a list of dictionaries or named tuples, I would like to do something like for <locals> in sql('select name, age from students'): print(name, age) I can achieve that with hacks like for x in sql('select name, age from students'): locals().update(*x) print(name, age) but I don't think this is guaranteed to work and it is ugly and inefficient.