Module implementing the parameter types code.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TTrue(val)
Checks if a given value evaluates to a boolean True value. |
source code
|
|
|
TElemOf(target_list)
Builds a function that checks if a given value is a member of a list. |
source code
|
|
|
|
|
|
|
|
|
TIsLength(size)
Check is the given container is of the given size. |
source code
|
|
|
TAnd(*args)
Combine multiple functions using an AND operation. |
source code
|
|
|
TOr(*args)
Combine multiple functions using an OR operation. |
source code
|
|
|
TMap(fn,
test)
Checks that a modified version of the argument passes the given test. |
source code
|
|
|
TRegex(pobj)
Checks whether a string matches a specific regular expression. |
source code
|
|
|
|
|
TMaybeValueNone(test)
Used for unsetting values. |
source code
|
|
|
|
|
|
|
|
|
|
|
TListOf(my_type)
Checks if a given value is a list with all elements of the same type. |
source code
|
|
|
TDictOf(key_type,
val_type)
Checks a dict type for the type of its key/values. |
source code
|
|
|
|
|
|
|
|
|
_PAREN_RE = re.compile("^[a-zA-Z0-9_-]+$")
|
|
NoDefault = object()
The without-default default value
|
|
NoType = object()
The no-type (value too complex to check it in the type system)
|
|
TNonEmptyString = WithDesc("NonEmptyString")(TAnd(TString, TTr...
a non-empty string
|
|
TMaybeString = TMaybe(TNonEmptyString)
a maybe non-empty string
|
|
TNonNegativeInt = TAnd(TInt, WithDesc("EqualOrGreaterThanZero"...
a non-negative integer (value >= 0)
|
|
TPositiveInt = TAnd(TInt, WithDesc("GreaterThanZero")(lambda v...
a positive integer (value > 0)
|
|
TMaybePositiveInt = TMaybe(TPositiveInt)
a maybe positive integer (positive integer or None)
|
|
TNegativeInt = TAnd(TInt, WithDesc("LessThanZero")(compat.part...
a negative integer (value < 0)
|
|
TNonNegativeFloat = TAnd(TFloat, WithDesc("EqualOrGreaterThanZ...
a positive float
|
|
TJobId = WithDesc("JobId")(TOr(TNonNegativeInt, TRegex(re.comp...
Job ID
|
|
TNumber = TOr(TInt, TFloat)
Number
|
|
TRelativeJobId = WithDesc("RelativeJobId")(TNegativeInt)
Relative job ID
|
|
TMaybeListOf = lambda item_type:
|