
June 29, 2013
7:51 p.m.
On 29 June 2013 18:19, MRAB <python@mrabarnett.plus.com> wrote:
On 30/06/13 02:20, Joshua Landau wrote:
I haven't been able to find a really good syntax from this, but something like:
1) foo(a, b, **(key1, key2 from locals()))
2) {**(key1, key2 from locals())}
3) import key1, key2 from {"key1": 123, "key2": 345}
etc.
You could just add a method to dict:
foo(a, b, **locals().subdict(["key1", "key2"]))
Only for (1), and (2) once http://bugs.python.org/issue2292 is in. Again, though, I don't really care about the syntax as it's not the point I was making.