Ejemplo n.º 1
0
	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
Ejemplo n.º 2
0
	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
Ejemplo n.º 3
0
	def __init__(self, items):
		Expr.__init__(self)
		if not shareds.isIterable(items):
			raise TypeError, "Expected list to be created from iterable"
		self.items = items