def __init__(self, namespace, name, typ = None, value = None): """Declare a variable. Args: name (str): name of the argument, typ (Type): type of the argument, value (?): initial vlaue (optional) namespace (Namespace): the namespace the variable belongs to. """ if isinstance( namespace, sympy.Basic ): NamedObject.__init__(self, None) self.var = namespace self.typ = name else: self.var = sympy.Symbol( name ) self.typ = typ NamedObject.__init__(self, name, namespace)
def __init__(self,name,namespace): NamedObject.__init__(self, name, namespace) self.args = [] self.ret = None self.local_namespace = Namespace(self.name) self.post_cond = True