Last active
September 13, 2018 03:35
-
-
Save hanxi/8825b9eeac36bcc808a1e7ae93c76f9b to your computer and use it in GitHub Desktop.
Python Dump
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void PrintRefCnt(const char *s, PyObject *obj) | |
{ | |
printf("PrintRefCnt:%s.%ld\n", s, (long)(obj->ob_refcnt)); | |
} | |
static void DumpPyObject(const char *s, PyObject *obj) | |
{ | |
PyObject *str = PyObject_Str(obj); | |
printf("DumpPyObject:%s.%s\n", s, PyString_AsString(obj)); | |
Py_DECREF(str); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment