Add tuple to list
Given a tuple (specifically the varargs functions), I want to add a list containing one or more elements and then call another function with the result as a list. So far, the best I've come up with is:
def fn(*args):
l = ['foo', 'bar']
l.extend(args)
fn2(l)
Which, given that Pythons have the usual patience when it comes to this sort of thing, it looks like it takes 2 more lines than it needs to. Is there a more pythonic way?
+2
source to share