From 207654c73f18d5ec809d7ba9a8b9f2b2add97e26 Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Sat, 22 Nov 2014 12:32:20 -0600 Subject: [PATCH] Add graph for PyMethodObject. --- _drafts/python-object-replacement.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/_drafts/python-object-replacement.md b/_drafts/python-object-replacement.md index 27817fc..338ca75 100644 --- a/_drafts/python-object-replacement.md +++ b/_drafts/python-object-replacement.md @@ -1,6 +1,6 @@ --- layout: post -title: Replacing Objects in Python +title: Finding and Replacing Objects in Python tags: Python description: More reflection than you cared to ask for draft: true @@ -735,7 +735,9 @@ person would give up here, but we still have a few tricks up our sleeve. Let's examine the internal C structure of bound methods, [`PyMethodObject`](https://github.com/python/cpython/blob/2.7/Include/classobject.h#L31). -[...] +%3clusterPyMethodObjectobj<__main__.A object at 0xdeadbeef>structstruct _object* _ob_nextstruct _object* _ob_prevPy_ssize_t ob_refcntstruct _typeobject* ob_typePyObject* im_funcPyObject* im_selfPyObject* im_classPyObject* im_weakrefliststruct:f->obj + +[`_PyObject_HEAD_EXTRA`](https://github.com/python/cpython/blob/2.7/Include/object.h#L64) [`PyCFunctionObject`](https://github.com/python/cpython/blob/2.7/Include/methodobject.h#L81)