def __init__(self, func, args): Expr.__init__(self) if not shareds.isIterable(args): raise TypeError, "Expected iterable as list of arguments" for i, arg in enumerate(args): if not isinstance(args[i], Expr): raise TypeError, "Argument %d is no expression" % (i + 1) self.func = func self.args = args
def __init__(self, args, dfn): Expr.__init__(self) if not shareds.isIterable(args): raise TypeError, "Expected iterable as list of arguments" for i in xrange(len(args)): if type(args[i]) not in (unicode, str): raise TypeError, "Name of parameter %d is no string" % (i + 1) if not isinstance(dfn, Expr): raise TypeError, "Expected expression (Expr) as definition" self.args = args[:] self.argc = len(args) self.dfn = dfn self.cscope = None # Creation scope
def __init__(self, items): Expr.__init__(self) if not shareds.isIterable(items): raise TypeError, "Expected list to be created from iterable" self.items = items