check whether a value is scalar

Eli eli.hen at gmail.com
Sat Apr 22 16:49:32 EDT 2006


Hi,

I want to check whether a value is a scalar. A scalar can be:
- None (null)
- string
- number (integer, float)
- boolean
How can I validate a value is one of these types?

I care about the value only, and not its class methods.
An object is not a scalar, since it's not a simple value.
An array might be considered as scalar.
The issue is I want to keep a set of values to share among several
applications in different languages, and only scalar values can be
shared. Since objects are not the same in all languages, it's possible
to share only simple values.

-thanks




More information about the Python-list mailing list