nested_dict documenting comment.

Signed-off-by: Edward Z. Yang <ezyang@fb.com>
This commit is contained in:
Edward Z. Yang
2017-10-17 09:50:19 -07:00
committed by Edward Z. Yang
parent 5989b05ecc
commit 0589dfab81

View File

@ -1,5 +1,11 @@
# TODO: refactor nested_dict into common library with ATen # TODO: refactor nested_dict into common library with ATen
class nested_dict(object): class nested_dict(object):
"""
A nested dict is a dictionary with a parent. If key lookup fails,
it recursively continues into the parent. Writes always happen to
the top level dict.
"""
def __init__(self, base, parent): def __init__(self, base, parent):
self.base, self.parent = base, parent self.base, self.parent = base, parent