Beispiel #1
0
 def __setattr__(self, name, value):
     id = _Singular.get_idhdl(name)
     if id.is_zero():
         raise Exception
     else:
         if isinstance(value, list):
             value = list2arg_list(value)
         id.write(value)
Beispiel #2
0
 def __setattr__(self, name, value):
     id = _Singular.get_idhdl(name)
     if id.is_zero():
         raise Exception
     else:
         if isinstance(value, list):
             value = list2arg_list(value)
         id.write(value)
Beispiel #3
0
            def fun_wrapper(*args):

                proc = _Singular.get_idhdl(name)
                if not proc.is_proc():
                    proc.print_type()
                    raise Exception
                prepare_ring(args)
                l = list2arg_list(args)
                erg = _Singular.call_interpreter_method(proc, l)
                finish_ring()
                return erg
Beispiel #4
0
            def fun_wrapper(*args):

                proc = _Singular.get_idhdl(name)
                if not proc.is_proc():
                    proc.print_type()
                    raise Exception
                prepare_ring(args)
                l = list2arg_list(args)
                erg = _Singular.call_interpreter_method(proc, l)
                finish_ring()
                return erg
Beispiel #5
0
    def __getattr__(self, name):
        proc = _Singular.get_idhdl(name)
        if proc.is_zero():
            if _Singular.is_builtin(name):

                def fun_wrapper(*args):
                    return self.__mycbm(name, *args)

                try:
                    fun_wrapper.__name__ = name
                except:
                    pass
                return fun_wrapper
            else:
                raise AttributeError(
                    "Global variable " + name +
                    " not present in the Singular interpreter")
        if proc.is_proc():

            def fun_wrapper(*args):

                proc = _Singular.get_idhdl(name)
                if not proc.is_proc():
                    proc.print_type()
                    raise Exception
                prepare_ring(args)
                l = list2arg_list(args)
                erg = _Singular.call_interpreter_method(proc, l)
                finish_ring()
                return erg

            try:
                fun_wrapper.__name__ = name
            except:
                pass
            return fun_wrapper
        else:
            res = _Singular.transfer_to_python(proc)
            if res is None:
                raise AttributeError("Global variable " + name +
                                     " has unknown type")
            return res
Beispiel #6
0
    def __getattr__(self, name):
        proc = _Singular.get_idhdl(name)
        if proc.is_zero():
            if _Singular.is_builtin(name):

                def fun_wrapper(*args):
                    return self.__mycbm(name, *args)

                try:
                    fun_wrapper.__name__ = name
                except:
                    pass
                return fun_wrapper
            else:
                raise AttributeError("Global variable " + name + " not present in the Singular interpreter")
        if proc.is_proc():

            def fun_wrapper(*args):

                proc = _Singular.get_idhdl(name)
                if not proc.is_proc():
                    proc.print_type()
                    raise Exception
                prepare_ring(args)
                l = list2arg_list(args)
                erg = _Singular.call_interpreter_method(proc, l)
                finish_ring()
                return erg

            try:
                fun_wrapper.__name__ = name
            except:
                pass
            return fun_wrapper
        else:
            res = _Singular.transfer_to_python(proc)
            if res is None:
                raise AttributeError("Global variable " + name + " has unknown type")
            return res