Re: check whether a value is scalar

2006-04-24 Thread Bruno Desthuilliers
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.

Re: check whether a value is scalar

2006-04-23 Thread Fredrik Lundh
"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

Re: check whether a value is scalar

2006-04-22 Thread Eli
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

Re: check whether a value is scalar

2006-04-22 Thread harold
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

Re: check whether a value is scalar

2006-04-22 Thread Roy Smith
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

check whether a value is scalar

2006-04-22 Thread Eli
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