* Brendan ([EMAIL PROTECTED]) wrote:
[...]
> Is there a simpler way to check that either all arguments are scalars,
> or all are lists of the same length?  Is this a poor way to structure
> things?  Your advice is appreciated

Disclaimer: I am new to python, so this may be a bad solution.

import types
def __init__(self,x,y,z):
    isOK = False
    if ( (type(x) == types.IntType) and (type(y) == types.IntType) and (type(z) 
== types.IntType) ):
        isOK = True
    if ( (type(x) == types.ListType) and (type(x) == types.ListType) and 
(type(x) == types.ListType) ):
        if ( (len(x) == len(y)) and (len(x) == len(z)) ):
            isOK = True

HTH,

mike

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

Reply via email to