Say I have a function:
def test(ab):
print ab.a
print ab.b
How can I easily pass arguments to this function without defining a class? I’m looking for something along the lines of:
test({4,5})
or
test(ab.a = 5, ab.b = 6)
Is this at all possible? Changing the function ‘test’ is not an option.
Use
collections.namedtuple: