Eli a écrit :
> Python treats integers as objects, but as I mentioned that I do care
> about the value only, and not its object methods. I mean that it's not
> possible to share objects among application in different programming
> languages, but it's possible to share the scalar values among them.
"Eli" <[EMAIL PROTECTED]> wrote:
> 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.
I can assure you that
Python treats integers as objects, but as I mentioned that I do care
about the value only, and not its object methods. I mean that it's not
possible to share objects among application in different programming
languages, but it's possible to share the scalar values among them.
Strings, booleans, int
would
isinstance(value,(type(None),str,int,float,bool))
be enough? This yields true if the type value is in the list of type
objects given as second argument, or a subtype of one of them. What,
however, do you mean with "I care about the value only, and not its
class method"?
--
http://mail
In article <[EMAIL PROTECTED]>,
"Eli" <[EMAIL PROTECTED]> wrote:
> 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 no
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