def get_class_func(pointer): instance = ctypes.cast(pointer, GTypeInstancePtr) gtype = PGType(G_TYPE_FROM_INSTANCE(instance.contents)) pytype = gtype.pytype if not pytype: raise RuntimeError("Couldn't find python type for %r" % gtype) return pytype
def test_gtype(self): self.assertEqual(PGType(0), PGType(GType(0)))