Is there any particular reason that my application says the argument must be callable or none type? I'm pretty sure this is how you'd instantiate a defaultdict with a defaultdict as its values.
dict = defaultdict(defaultdict(set))
The argument provided to the defaultdict constructor must be a zero-argument callable (see the docs), so defaultdict(defaultdict) does work, but defaultdict(defaultdict(set)) does not. You can 'cheat' a little though:
d = defaultdict(lambda: defaultdict(set))
That way you provide a zero-argument callable in the form of the lambda function which in turn, when called, returns the appropriate default value you want.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With