How to use the ptype.isptype function in ptype

To help you get started, we’ve selected a few ptype examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github arizvisa / syringe / lib / ptypes / parray.py View on Github external
def __repr__(self):
        res = '???'
        if self.initialized:
            res = repr(''.join(self.serialize()))

        ofs = '[%x]'%( self.getoffset() )

        if ptype.isptype(self._object_):
            obj = repr(self._object_)
        else:
            obj = repr(self._object_.__class__)

        return ' '.join((ofs, self.name(), '%s[%d]'% (obj, len(self)), res))