1.1 --- a/micropython/basicdata.py Tue Apr 01 00:19:03 2014 +0200
1.2 +++ b/micropython/basicdata.py Thu May 01 23:03:06 2014 +0200
1.3 @@ -113,45 +113,4 @@
1.4
1.5 __shortrepr__ = __repr__
1.6
1.7 -# Data objects appearing in programs before run-time.
1.8 -
1.9 -class Const(Constant, TypedInstance):
1.10 -
1.11 - "A constant object with no context."
1.12 -
1.13 - def __init__(self, value):
1.14 - Instance.__init__(self)
1.15 - self.value = value
1.16 -
1.17 - def get_value(self):
1.18 - return self.value
1.19 -
1.20 - def __repr__(self):
1.21 - return "Const(%r)" % self.value
1.22 -
1.23 - __shortrepr__ = __repr__
1.24 -
1.25 - # Support constants as dictionary keys in order to build constant tables.
1.26 -
1.27 - def __eq__(self, other):
1.28 - return other is not None and isinstance(other, Const) and \
1.29 - self.value == other.value and self.value.__class__ is other.value.__class__
1.30 -
1.31 - def __ne__(self, other):
1.32 - return not self.__eq__(other)
1.33 -
1.34 - def __hash__(self):
1.35 - return hash(self.value)
1.36 -
1.37 - # Constants are instances of various built-in types.
1.38 -
1.39 - def value_type_name(self):
1.40 - return ".".join(self.value_type_name_parts())
1.41 -
1.42 - def value_type_name_parts(self):
1.43 - return "__builtins__", self.get_class_name()
1.44 -
1.45 - def get_class_name(self):
1.46 - return self.value.__class__.__name__
1.47 -
1.48 # vim: tabstop=4 expandtab shiftwidth=4