Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/TurtleArt/tatype.py
diff options
context:
space:
mode:
authorMarion <marion.zepf@gmail.com>2013-09-04 09:03:36 (GMT)
committer Marion <marion.zepf@gmail.com>2013-09-04 09:03:36 (GMT)
commit6ee1bb7f1a827d2b6e1d898c63d8017fa95d7222 (patch)
tree2e18ce5da1fa720da68a44f729dcf1ebb8d0e7a2 /TurtleArt/tatype.py
parentdad6e183fe30339a6bb450ee8e9a02fe534dbb32 (diff)
update Primitives for the 'store in' and 'box' blocks
- They are not yet exportable. - Fix TypeDisjunctions as return types of Primitives.
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)