A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2013-February/123908.html below:

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

[Python-Dev] Force to use Py_CLEAR and Py_VISIT in example for Python extending [Python-Dev] Force to use Py_CLEAR and Py_VISIT in example for Python extendingBenjamin Peterson benjamin at python.org
Sat Feb 9 14:54:20 CET 2013
2013/2/9 Andrew Svetlov <andrew.svetlov at gmail.com>:
> 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)
>             return vret;
>     }
>
> and
>
>     tmp = self->first;
>     self->first = NULL;
>     Py_XDECREF(tmp);
>
> and replace those to Py_VISIT and Py_CLEAN.
>
> 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?

IMO, it's fine if you change 2.7, too.



-- 
Regards,
Benjamin
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4