Revision 1007
Added by Aaron Marcuse-Kubitza almost 13 years ago
util.py | ||
---|---|---|
18 | 18 |
|
19 | 19 |
def root_module(value): return module(value)[0] |
20 | 20 |
|
21 |
#### Basic types
|
|
21 |
#### Type checking
|
|
22 | 22 |
|
23 | 23 |
class ConstraintError(ValueError): |
24 | 24 |
def __init__(self, check_func, value): |
... | ... | |
32 | 32 |
|
33 | 33 |
def is_str(val): return isinstance(val, basestring) |
34 | 34 |
|
35 |
def is_list(val): return isinstance(val, list) |
|
36 |
|
|
35 | 37 |
#### Iterables |
36 | 38 |
|
37 | 39 |
def first(iter_): return iter_.next() |
Also available in: Unified diff
util.py: Added is_list()