|
|
|
|
|
by Spivak
1324 days ago
|
|
Sometimes a you just have to accept a language's limitations. Try in Python to make a nested defaultdict you can access like the following. d = <something>
d["a"]["b"]["c"] # --> 42
Can't be done because it's impossible for user code to detect what the last __getitem__ call is and return the default.Edit: Dang it, I mean arbitrary depth. |
|