[New-bugs-announce] [issue26824] Make some macros use Py_TYPE

Xiang Zhang report at bugs.python.org
Fri Apr 22 00:54:50 EDT 2016


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 <report at bugs.python.org>
<http://bugs.python.org/issue26824>
_______________________________________


More information about the New-bugs-announce mailing list