Add TMaybeList as a new type for parameters
authorMichele Tartara <mtartara@google.com>
Mon, 25 Mar 2013 14:15:26 +0000 (15:15 +0100)
committerMichele Tartara <mtartara@google.com>
Mon, 22 Apr 2013 11:10:55 +0000 (11:10 +0000)
This will be used as the type for the reason trail parameter.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

lib/ht.py

index 42e533b..a452239 100644 (file)
--- a/lib/ht.py
+++ b/lib/ht.py
@@ -356,6 +356,9 @@ TMaybeBool = TMaybe(TBool)
 #: Maybe a dictionary (dict or None)
 TMaybeDict = TMaybe(TDict)
 
+#: Maybe a list (list or None)
+TMaybeList = TMaybe(TList)
+
 #: a non-negative integer (value >= 0)
 TNonNegativeInt = \
   TAnd(TInt, WithDesc("EqualOrGreaterThanZero")(lambda v: v >= 0))