I just run into the following way of implementing AutoVivification in Python:
from collections import defaultdict
Tree = lambda: defaultdict(Tree)
# common name by class, order, genus, and type-species
common_name = Tree()
common_name['Mammalia']['Primates']['Homo']['H. sapiens'] = 'human being'
How does the following construction work?
Tree = lambda: defaultdict(Tree)
Tree does not seem to be defined before the body of the lambda function, and it is not passed as an argument.
How does the body of the lambda function know of Tree before it is defined? What other types of recursive definitions are supported by the language?