Personally think, ruby got it right where we can pass a lambda with the `key` parameter.
``` In [22]: foo = defaultdict(lambda k: k)
In [23]: foo[1] --------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-23-5a39798fc62e> in <module> ----> 1 foo[1]
TypeError: <lambda>() missing 1 required positional argument: 'k' ```
I could envision this being useful for using a defaultdict as something like a local cache for something where requests are expensive. Below is how one might want to use it but it'll fail because the lambda is not given the key argument.
``` profiles = defaultdict(lambda p_id: get_profile_from_site(p_id)) ```