I'd like to generate a large list of lists to pass to a function. Part of this is passing keyword arguments, but I can't seem to get it to work, as the keyword dict gets scooped up as a positional argument:
mylist = [
['cheese', 'toast', 'bread', {exempt=True}],
['bagel', 'apple', 'oatmeal', {exempt=True}],
]
for i in mylist:
myfunc(*i)
def myfunc(first, *args, exempt=False, **kwargs):
if exempt:
return
Hopefully this gets the idea across. Is this sort of implementation possible?