[Python-Dev] Force to use Py_CLEAR and Py_VISIT in example for Python extending

Nick Coghlan ncoghlan at gmail.com
Sat Feb 9 15:01:55 CET 2013

On Sat, Feb 9, 2013 at 11:52 PM, Andrew Svetlov
<andrew.svetlov at gmail.com> wrote:
> I think we have to demonstrate best practices in our examples.
> Let's py2.7 branch live untouched, change only docs for python 3.x
> Any objections?

For debugging purposes, I think extension developers do need to
understand what those macros are doing under the covers. However, the
order of presentation should definitely be reversed to "here is how
you should write it", followed by an explanation of what that actually
means with the macros expanded.

For Py_CLEAR, it would be OK to just link to the macro's entry in the
C API docs, but for Py_VISIT, I think it's worth expanding out the
full example.


Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia

More information about the Python-Dev mailing list