1. Alberto Torres
  2. pygamekit


pygamekit / pywrap.pxi

#from gkmath cimport *

cdef class pywrap:
    cdef void *_p
    def __richcmp__(pywrap self, pywrap other, op):
        print other
        if op==2:   # __eq__
            return self._p == other._p
        elif op==3: # __ne__
            return self._p != other._p
        return False
    #cdef inline pywrap P(self, void *p):
        #(<pywrap>self)._p = p
        #return self

cdef inline wrap(wtype, void *p):
    ret = wtype.__new__(wtype)
    (<pywrap>ret)._p = p
    return ret
# TODO: The functions should return the same pyobject for the same gkobject