示例#1
0
文件: Code.py 项目: dagss/cython
    def put_decref_clear(self, cname, type, nanny=True):
        from PyrexTypes import py_object_type, typecast

        if nanny:
            self.putln("__Pyx_DECREF(%s); %s = 0;" % (typecast(py_object_type, type, cname), cname))
        else:
            self.putln("Py_DECREF(%s); %s = 0;" % (typecast(py_object_type, type, cname), cname))
示例#2
0
 def put_decref_clear(self, cname, type, nanny=True):
     from PyrexTypes import py_object_type, typecast
     if nanny:
         self.putln("__Pyx_DECREF(%s); %s = 0;" %
                    (typecast(py_object_type, type, cname), cname))
     else:
         self.putln("Py_DECREF(%s); %s = 0;" %
                    (typecast(py_object_type, type, cname), cname))
示例#3
0
 def put_init_to_py_none(self, cname, type, nanny=True):
     from PyrexTypes import py_object_type, typecast
     py_none = typecast(type, py_object_type, "Py_None")
     if nanny:
         self.putln("%s = %s; __Pyx_INCREF(Py_None);" % (cname, py_none))
     else:
         self.putln("%s = %s; Py_INCREF(Py_None);" % (cname, py_none))
示例#4
0
文件: Code.py 项目: certik/cython
 def put_init_to_py_none(self, cname, type, nanny=True):
     from PyrexTypes import py_object_type, typecast
     py_none = typecast(type, py_object_type, "Py_None")
     if nanny:
         self.putln("%s = %s; __Pyx_INCREF(Py_None);" % (cname, py_none))
     else:
         self.putln("%s = %s; Py_INCREF(Py_None);" % (cname, py_none))
示例#5
0
文件: Code.py 项目: dagss/cython
    def as_pyobject(self, cname, type):
        from PyrexTypes import py_object_type, typecast

        return typecast(py_object_type, type, cname)
示例#6
0
文件: Code.py 项目: enyst/plexnet
 def put_init_to_py_none(self, cname, type):
     py_none = typecast(type, py_object_type, "Py_None")
     self.putln("%s = %s; Py_INCREF(Py_None);" % (cname, py_none))
示例#7
0
文件: Code.py 项目: enyst/plexnet
 def put_decref_clear(self, cname, type):
     self.putln("Py_DECREF(%s); %s = 0;" % (
         typecast(py_object_type, type, cname), cname))
示例#8
0
文件: Code.py 项目: enyst/plexnet
 def as_pyobject(self, cname, type):
     return typecast(py_object_type, type, cname)
示例#9
0
 def as_pyobject(self, cname, type):
     from PyrexTypes import py_object_type, typecast
     return typecast(py_object_type, type, cname)
示例#10
0
 def put_init_to_py_none(self, cname, type):
     py_none = typecast(type, py_object_type, "Py_None")
     self.putln("%s = %s; Py_INCREF(Py_None);" % (cname, py_none))
示例#11
0
 def put_decref_clear(self, cname, type):
     self.putln("Py_DECREF(%s); %s = 0;" %
                (typecast(py_object_type, type, cname), cname))
示例#12
0
 def as_pyobject(self, cname, type):
     return typecast(py_object_type, type, cname)
示例#13
0
	def as_pyobject(self, cname, type):
		if type:
			return typecast(py_object_type, type, cname)
		else:
			return cname