From 6ee1bb7f1a827d2b6e1d898c63d8017fa95d7222 Mon Sep 17 00:00:00 2001 From: Marion Date: Wed, 04 Sep 2013 09:03:36 +0000 Subject: update Primitives for the 'store in' and 'box' blocks - They are not yet exportable. - Fix TypeDisjunctions as return types of Primitives. --- (limited to 'TurtleArt/tatype.py') 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) -- cgit v0.9.1