Revision b1e47e2d lib/ht.py
b/lib/ht.py | ||
---|---|---|
352 | 352 |
TRelativeJobId = WithDesc("RelativeJobId")(TStrictNegativeInt) |
353 | 353 |
|
354 | 354 |
|
355 |
def TInstanceOf(my_inst): |
|
356 |
"""Checks if a given value is an instance of my_inst. |
|
357 |
|
|
358 |
""" |
|
359 |
desc = WithDesc("Instance of %s" % (Parens(my_inst), )) |
|
360 |
return desc(lambda val: isinstance(val, my_inst)) |
|
361 |
|
|
362 |
|
|
355 | 363 |
def TListOf(my_type): |
356 | 364 |
"""Checks if a given value is a list with all elements of the same type. |
357 | 365 |
|
Also available in: Unified diff