New submission from Serhiy Storchaka: In the comment to issue28765 patch Victor suggested to replace "Py_INCREF(Py_None); return Py_None;" with "Py_RETURN_NONE;".
Here is a Coccinelle [1] semantic patch that replaces all returns of new references to None, True or False with macros Py_RETURN_NONE, Py_RETURN_TRUE or Py_RETURN_FALSE correspondingly. [1] http://coccinelle.lip6.fr/ ---------- components: Extension Modules, Interpreter Core files: py_return.cocci messages: 283480 nosy: haypo, serhiy.storchaka priority: normal severity: normal status: open title: Use Py_RETURN_NONE and like type: enhancement versions: Python 3.7 Added file: http://bugs.python.org/file45936/py_return.cocci _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue28999> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com