Message366473
| Author |
vstinner |
| Recipients |
corona10, nascheme, petdance, serhiy.storchaka, shihai1991, steve.dower, vstinner |
| Date |
2020年04月15日.01:35:27 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1586914527.97.0.175492629419.issue39573@roundup.psfhosted.org> |
| In-reply-to |
| Content |
PyType_FromSpec() and PyType_Spec API are not currently compatible with opaque PyObject.
Example:
---
#define PyObject_HEAD PyObject ob_base;
typedef struct {
PyObject_HEAD
...
} MyObject;
static PyType_Spec type_spec = {
.name = "MyObject",
.basicsize = sizeof(MyObject),
...
};
... = PyType_FromSpec(&type_spec);
---
sizeof(MyObject) requires to compute sizeof(PyObject).
Issue reported by Ronald Oussoren on python-dev:
https://mail.python.org/archives/list/python-dev@python.org/message/PGKRW7S2IUOWVRX6F7RT6VAWD3ZPUDYS/ |
|