[issue39573] [C API] Make PyObject an opaque structure in the limited C API

STINNER Victor report at bugs.python.org
Tue Jun 2 20:18:04 EDT 2020


STINNER Victor <vstinner at python.org> added the comment:

> bpo-39573: Convert Py_TYPE() to a static inline function (GH-20290)

This change broke pycurl:
https://github.com/pycurl/pycurl/pull/636

Extract of its current code:
"""
    /* Initialize the type of the new type objects here; doing it here
     * is required for portability to Windows without requiring C++. */
    p_Curl_Type = &Curl_Type;
    p_CurlMulti_Type = &CurlMulti_Type;
    p_CurlShare_Type = &CurlShare_Type;
    Py_TYPE(&Curl_Type) = &PyType_Type; 
    Py_TYPE(&CurlMulti_Type) = &PyType_Type; 
    Py_TYPE(&CurlShare_Type) = &PyType_Type; 
"""

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39573>
_______________________________________


More information about the Python-bugs-list mailing list