From: Nathan Binkert Date: Tue, 22 Sep 2009 22:24:16 +0000 (-0700) Subject: multiattrdict: make multilevel nesting work properly X-Git-Tag: stable_2012_02_02~1735 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0d58d32ad51eed32e6c7f9135b901006777fbe87;p=gem5.git multiattrdict: make multilevel nesting work properly --- diff --git a/src/python/m5/util/attrdict.py b/src/python/m5/util/attrdict.py index 3336632f5..8f7d59698 100644 --- a/src/python/m5/util/attrdict.py +++ b/src/python/m5/util/attrdict.py @@ -58,7 +58,7 @@ class multiattrdict(attrdict): try: return super(multiattrdict, self).__getattr__(attr) except AttributeError: - d = optiondict() + d = multiattrdict() setattr(self, attr, d) return d @@ -86,8 +86,12 @@ if __name__ == '__main__': print dir(x) print(x) + print + print "multiattrdict" x = multiattrdict() + x.x.x.x = 9 x.y.z = 9 print x print x.y print x.y.z + print x.z.z