1.1 --- a/micropython/data.py Mon Oct 22 00:11:06 2012 +0200
1.2 +++ b/micropython/data.py Sun Oct 28 18:01:30 2012 +0100
1.3 @@ -65,7 +65,7 @@
1.4 except NameError:
1.5 from sets import Set as set
1.6
1.7 -class NamespaceDict:
1.8 +class NamespaceDict(Namespace):
1.9
1.10 "A mix-in providing dictionary methods."
1.11
1.12 @@ -1656,6 +1656,15 @@
1.13 self.allattr[name] = attr
1.14 return self.allattr
1.15
1.16 + def get_static_attribute(self, name):
1.17 +
1.18 + """
1.19 + Return a static attribute for the given 'name' or None if no such
1.20 + attribute exists.
1.21 + """
1.22 +
1.23 + return self.all_class_attributes().get(name)
1.24 +
1.25 class TypeClass(Class):
1.26
1.27 "A special class for the type class."
1.28 @@ -2080,6 +2089,15 @@
1.29
1.30 return dict(self)
1.31
1.32 + def get_static_attribute(self, name):
1.33 +
1.34 + """
1.35 + Return a static attribute for the given 'name' or None if no such
1.36 + attribute exists.
1.37 + """
1.38 +
1.39 + return self.get(name)
1.40 +
1.41 def modify_name(self, name):
1.42
1.43 """