from xml.etree.ElementTree import ElementTree
+# Python 3 moved this for no really good reason.
+try:
+ from sys import intern
+except ImportError:
+ pass
+
try:
from io import StringIO
except ImportError:
def __init__(self, type, value):
if type not in self.VALID_TYPES:
raise ValueError("invalid type %r" % type)
- self.type = type
+ self.type = intern(type)
self.value = value
def __getstate__(self):
def __init__(self, type, value):
if type not in self.VALID_TYPES:
raise ValueError("invalid type %r" % type)
- self.type = type
+ self.type = intern(type)
self.value = value
def __getstate__(self):
def __init__(self, type, x, y):
if type not in self.VALID_TYPES:
raise ValueError("invalid type %r" % type)
- self.type = type
+ self.type = intern(type)
self.x = x
self.y = y
)
def __init__(self, type="none", actions=None):
- self.type = type
+ self.type = intern(type)
self.actions = [] if actions is None else actions
def __getstate__(self):