Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/TurtleArt/tatype.py
diff options
context:
space:
mode:
Diffstat (limited to 'TurtleArt/tatype.py')
-rw-r--r--TurtleArt/tatype.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/TurtleArt/tatype.py b/TurtleArt/tatype.py
index 164ba2a..86119b6 100644
--- a/TurtleArt/tatype.py
+++ b/TurtleArt/tatype.py
@@ -49,7 +49,19 @@ class Type(object):
class TypeDisjunction(tuple,Type):
""" Disjunction of two or more Types (from the type hierarchy) """
- pass
+
+ def __init__(self, iterable):
+ self = tuple(iterable)
+
+
+ def __str__(self):
+ s = ["("]
+ for disj in self:
+ s.append(str(disj))
+ s.append(" or ")
+ s.pop()
+ s.append(")")
+ return "".join(s)
TYPE_OBJECT = Type('object', 0)