root/lib/scalar.py @ 7931
1 | 6752 | aaronmk | # Scalars (single, literal values)
|
---|---|---|---|
2 | |||
3 | 7105 | aaronmk | import datetime |
4 | 6752 | aaronmk | import types |
5 | |||
6 | def is_scalar(value): |
||
7 | 7105 | aaronmk | return isinstance(value, (types.NoneType, bool, int, float, basestring, |
8 | datetime.datetime)) |
||
9 | 7115 | aaronmk | |
10 | def is_nonnull_scalar(value): return is_scalar(value) and value != None |