It's me wrote:
"It's me" <[EMAIL PROTECTED]> wrote in message news:EO6Ad.3296>

I need to look up and see what:

         if not isinstance(arg2, basestring):

does.

Okay, I got the idea there.

Now, what if arg2 is not a string but either a number or a bunch of numbers?
Using your method, can I say something to the effect of "if arg2 is *not* an
instance of a simple number"?

The isinstance function takes either a single type, or a tuple of types, so you can do something like:


    if not isinstance(arg2, (int, long, float)):

or if you want to include strings as well:

    if not isinstance(arg2, (basestring, int, long, float)):


Steve -- http://mail.python.org/mailman/listinfo/python-list

Reply via email to