1.1 --- a/micropython/basicdata.py Mon Oct 22 00:11:06 2012 +0200
1.2 +++ b/micropython/basicdata.py Sun Oct 28 18:01:30 2012 +0100
1.3 @@ -39,10 +39,29 @@
1.4 else:
1.5 return self.parent.full_name()
1.6
1.7 +class Namespace:
1.8 +
1.9 + "A mix-in providing basic namespace functionality."
1.10 +
1.11 + def get_static_attribute(self, name):
1.12 +
1.13 + """
1.14 + Return a static attribute for the given 'name' or None if no such
1.15 + attribute exists.
1.16 + """
1.17 +
1.18 + return None
1.19 +
1.20 +class Constant:
1.21 +
1.22 + "A superclass for all constant or context-free structures."
1.23 +
1.24 + pass
1.25 +
1.26 # Instances are special in that they need to be wrapped together with context in
1.27 # a running program, but they are not generally constant.
1.28
1.29 -class Instance:
1.30 +class Instance(Namespace):
1.31
1.32 "A placeholder indicating the involvement of an instance."
1.33
1.34 @@ -74,12 +93,6 @@
1.35 def make_instance():
1.36 return common_instance
1.37
1.38 -class Constant:
1.39 -
1.40 - "A superclass for all constant or context-free structures."
1.41 -
1.42 - pass
1.43 -
1.44 # Data objects appearing in programs before run-time.
1.45
1.46 class Const(Constant, Instance):