The strict check if a tuple is indeed a tuple in the result validation
system is too strict for the current assumptions in the system. This
patch permits lists to be used when tuples are expected, provided they
still satisfy the type constraints.

Signed-off-by: Hrvoje Ribicic <[email protected]>
---
 lib/ht.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/ht.py b/lib/ht.py
index 590c852..8571e34 100644
--- a/lib/ht.py
+++ b/lib/ht.py
@@ -433,7 +433,8 @@ def TTupleOf(*val_types):
 
   """
   desc = WithDesc("Tuple of %s" % (Parens(val_types), ))
-  return desc(TAnd(TTuple, TIsLength(len(val_types)), TItems(val_types)))
+  return desc(TAnd(TOr(TTuple, TList), TIsLength(len(val_types)),
+                   TItems(val_types)))
 
 
 def TSetOf(val_type):
-- 
2.0.0.526.g5318336

Reply via email to