Ejemplo n.º 1
0
Archivo: Code.py Proyecto: 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))
Ejemplo n.º 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))
Ejemplo n.º 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))
Ejemplo n.º 4
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))
Ejemplo n.º 5
0
Archivo: Code.py Proyecto: dagss/cython
    def as_pyobject(self, cname, type):
        from PyrexTypes import py_object_type, typecast

        return typecast(py_object_type, type, cname)
Ejemplo n.º 6
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))
Ejemplo n.º 7
0
 def put_decref_clear(self, cname, type):
     self.putln("Py_DECREF(%s); %s = 0;" % (
         typecast(py_object_type, type, cname), cname))
Ejemplo n.º 8
0
 def as_pyobject(self, cname, type):
     return typecast(py_object_type, type, cname)
Ejemplo n.º 9
0
 def as_pyobject(self, cname, type):
     from PyrexTypes import py_object_type, typecast
     return typecast(py_object_type, type, cname)
Ejemplo n.º 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))
Ejemplo n.º 11
0
 def put_decref_clear(self, cname, type):
     self.putln("Py_DECREF(%s); %s = 0;" %
                (typecast(py_object_type, type, cname), cname))
Ejemplo n.º 12
0
 def as_pyobject(self, cname, type):
     return typecast(py_object_type, type, cname)
Ejemplo n.º 13
0
	def as_pyobject(self, cname, type):
		if type:
			return typecast(py_object_type, type, cname)
		else:
			return cname