Sometimes, I amaze myself with what I don't know. Here is a simple case: in python, you can pass a function a dictionary with keys with the same name as the function's arguments. For some reason, I thought this was only available when you identified keyword arguments.
>>> def foo(a, b) :
... return a + b
...
>>> foo(2, 5)
7
>>> d = {'a':2, 'b':5}
>>> foo(**d)
7

Leave a comment