I would like to nest an arbitrary number of defaultdicts like so:

```
from collections import defaultdict   
D = defaultdict( lambda:defaultdict(int) )

```

this works fine as described [earlier](https://stackoverflow.com/questions/5029934/python-defaultdict-of-defaultdict).

Now I'm looking for the way/function to do this for an arbitrary depth:
so for instance I'd like to have a function 

```
def Gen_DDict( dim=3 ):
    "code I'm looking for"

```

that will return this for dim=3:

```
defaultdict( lambda : defaultdict( lambda : defaultdict(int) ) )

```