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

2013-02-09 Thread Nick Coghlan
On Sat, Feb 9, 2013 at 11:52 PM, Andrew Svetlov 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 ma

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

2013-02-09 Thread Benjamin Peterson
2013/2/9 Andrew Svetlov : > For now > http://docs.python.org/3/extending/newtypes.html#supporting-cyclic-garbage-collection > at first the doc demonstrate long way than note Py_CLEAR and Py_VISIT > macroses. > > I like to remove code similar to > > if (self->first) { > vret = visit(se

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

2013-02-09 Thread Andrew Svetlov
For now http://docs.python.org/3/extending/newtypes.html#supporting-cyclic-garbage-collection at first the doc demonstrate long way than note Py_CLEAR and Py_VISIT macroses. I like to remove code similar to if (self->first) { vret = visit(self->first, arg); if (vret != 0)