New submission from Xiang Zhang: According to PEP3123, all accesses to ob_refcnt and ob_type MUST cast the object pointer to PyObject* (unless the pointer is already known to have that type), and SHOULD use the respective accessor macros.
I find that there are still some macros in Python use (obj)->ob_type. Though right now they may not impose any error, but as macros, they may be used with arguments not of type PyObject* later and introduce errors. So I think change them to use Py_TYPE is not a bad idea. ---------- files: change_some_macros_using_Py_TYPE.patch keywords: patch messages: 263956 nosy: serhiy.storchaka, xiang.zhang priority: normal severity: normal status: open title: Make some macros use Py_TYPE Added file: http://bugs.python.org/file42563/change_some_macros_using_Py_TYPE.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26824> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com