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 AND 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
|
|
|
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 = TOr(TNonEmptyString, TNone)
a maybe non-empty string
|
|
TMaybeBool = TOr(TBool, TNone)
a maybe boolean (bool or none)
|
|
TMaybeDict = TOr(TDict, TNone)
Maybe a dictionary (dict or None)
|
|
TPositiveInt = TAnd(TInt, WithDesc("EqualGreaterZero")(lambda ...
a positive integer
|
|
TStrictPositiveInt = TAnd(TInt, WithDesc("GreaterThanZero")(la...
a strictly positive integer
|
|
TStrictNegativeInt = TAnd(TInt, WithDesc("LessThanZero")(compa...
a strictly negative integer (0 > value)
|
|
TPositiveFloat = TAnd(TFloat, WithDesc("EqualGreaterZero")(lam...
a positive float
|
|
TJobId = WithDesc("JobId")(TOr(TPositiveInt, TRegex(re.compile...
Job ID
|
|
TNumber = TOr(TInt, TFloat)
Number
|
|
TRelativeJobId = WithDesc("RelativeJobId")(TStrictNegativeInt)
Relative job ID
|