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