[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2022-01-28 Thread STINNER Victor
STINNER Victor added the comment: Changes already done: * Macros converted to regular functions: * PyObject_GET_WEAKREFS_LISTPTR(); add internal inline _PyObject_GET_WEAKREFS_LISTPTR() * PyType_SUPPORTS_WEAKREFS(); add internal inline _PyType_SUPPORTS_WEAKREFS() *

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2022-01-27 Thread STINNER Victor
STINNER Victor added the comment: New changeset 18ea973c21ee4a6adc26be41027881043fa498eb by Victor Stinner in branch 'main': bpo-40170: Remove PyHeapType_GET_MEMBERS() macro (GH-30942) https://github.com/python/cpython/commit/18ea973c21ee4a6adc26be41027881043fa498eb --

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2022-01-27 Thread STINNER Victor
STINNER Victor added the comment: New changeset 0575551f69ba9c999835bfb176a543d468083c03 by Victor Stinner in branch 'main': bpo-40170: Move _Py_GetAllocatedBlocks() to pycore_pymem.h (GH-30943) https://github.com/python/cpython/commit/0575551f69ba9c999835bfb176a543d468083c03 --

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2022-01-26 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +29122 pull_request: https://github.com/python/cpython/pull/30943 ___ Python tracker ___

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2022-01-26 Thread STINNER Victor
STINNER Victor added the comment: New changeset 6b491b9dc0b0fdfd1f07ea4e2151236186d8e7e6 by Victor Stinner in branch 'main': bpo-40170: Remove _Py_GetAllocatedBlocks() function (GH-30940) https://github.com/python/cpython/commit/6b491b9dc0b0fdfd1f07ea4e2151236186d8e7e6 --

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2022-01-26 Thread STINNER Victor
STINNER Victor added the comment: New changeset af32b3ef1fbad3c2242627a14398320960a0cb45 by Victor Stinner in branch 'main': bpo-40170: PyType_SUPPORTS_WEAKREFS() becomes a regular function (GH-30938) https://github.com/python/cpython/commit/af32b3ef1fbad3c2242627a14398320960a0cb45

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2022-01-26 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +29121 pull_request: https://github.com/python/cpython/pull/30942 ___ Python tracker ___

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2022-01-26 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +29119 pull_request: https://github.com/python/cpython/pull/30940 ___ Python tracker ___

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2022-01-26 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +29117 pull_request: https://github.com/python/cpython/pull/30938 ___ Python tracker ___

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2022-01-26 Thread STINNER Victor
STINNER Victor added the comment: In the top 5000 PyPI projects, the _PyObject_SIZE() and _PyObject_VAR_SIZE() functions are used by 7 projects: * Cython-0.29.26 * frozendict-2.2.0: implement "sizeof" function, found in copies of Objects/dictobject.c file * JPype1-1.3.0 * numpy-1.22.1:

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2022-01-26 Thread STINNER Victor
STINNER Victor added the comment: I searched for "_PyObject_DebugMallocStats" in top 5000 PyPI projects. There is a single project using it: guppy3. Extract of guppy3 src/heapy/xmemstats.c: ... dlptr__PyObject_DebugMallocStats = addr_of_symbol("_PyObject_DebugMallocStats"); ... static

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2022-01-26 Thread STINNER Victor
STINNER Victor added the comment: I searched for "_PyGC_FINALIZED" in top 5000 PyPI projects. It seems like only Cython is impacted. ddtrace and guppy3 use directly the internal C API. == Cython 0.29.26 == * Cython/Compiler/ModuleNode.py: finalised_check = '!_PyGC_FINALIZED(o)' *

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2022-01-26 Thread STINNER Victor
STINNER Victor added the comment: TODO: * Macros still accessing directly PyTypeObject members: * PyHeapType_GET_MEMBERS() * PySequence_ITEM() * _PyObject_SIZE() * _PyObject_VAR_SIZE() * PyType_SUPPORTS_WEAKREFS() * Try again to apply "bpo-40170: PyType_HasFeature() now always

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2021-11-08 Thread STINNER Victor
STINNER Victor added the comment: New changeset 80580f5ab85e3c45c8c5e863a891598d10bf by Miss Islington (bot) in branch '3.9': bpo-40170: Update What's New in Python 3.9 (GH-29470) (GH-29472) https://github.com/python/cpython/commit/80580f5ab85e3c45c8c5e863a891598d10bf --

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2021-11-08 Thread miss-islington
miss-islington added the comment: New changeset 69b3de65adc691cc5ad66e70e5c7caf61c202c79 by Miss Islington (bot) in branch '3.10': bpo-40170: Update What's New in Python 3.9 (GH-29470) https://github.com/python/cpython/commit/69b3de65adc691cc5ad66e70e5c7caf61c202c79 --

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2021-11-08 Thread miss-islington
Change by miss-islington : -- pull_requests: +27724 pull_request: https://github.com/python/cpython/pull/29471 ___ Python tracker ___

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2021-11-08 Thread miss-islington
Change by miss-islington : -- pull_requests: +27725 pull_request: https://github.com/python/cpython/pull/29472 ___ Python tracker ___

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2021-11-08 Thread STINNER Victor
STINNER Victor added the comment: New changeset 99c7e9853fa13af414168f179213e3d2fae03a45 by Victor Stinner in branch 'main': bpo-40170: Update What's New in Python 3.9 (GH-29470) https://github.com/python/cpython/commit/99c7e9853fa13af414168f179213e3d2fae03a45 --

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2021-11-08 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +27723 pull_request: https://github.com/python/cpython/pull/29470 ___ Python tracker ___

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2021-02-17 Thread STINNER Victor
STINNER Victor added the comment: New changeset 630264a152115f9671d6b793455ef5c2cea09a97 by Erlend Egeberg Aasland in branch 'master': bpo-40170: Move 3 NEWS entries to the C API section (GH-24555) https://github.com/python/cpython/commit/630264a152115f9671d6b793455ef5c2cea09a97

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2021-02-17 Thread Erlend Egeberg Aasland
Change by Erlend Egeberg Aasland : -- pull_requests: +23341 pull_request: https://github.com/python/cpython/pull/24555 ___ Python tracker ___

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2021-02-17 Thread Erlend Egeberg Aasland
Erlend Egeberg Aasland added the comment: > This can introduce a performance slowdown and so should wait until the PEP > 620 is accepted. Noted. -- ___ Python tracker ___

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2021-02-17 Thread STINNER Victor
STINNER Victor added the comment: > For PySequence_ITEM, I guess adding a private C version (for example > _PySequence_Item) and redirecting the macro to the C version would be > acceptable. This can introduce a performance slowdown and so should wait until the PEP 620 is accepted.

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2021-02-17 Thread STINNER Victor
STINNER Victor added the comment: New changeset cd80f430daa7dfe7feeb431ed34f88db5f64aa30 by Erlend Egeberg Aasland in branch 'master': bpo-40170: Always define PyExceptionClass_Name() as a function (GH-24553) https://github.com/python/cpython/commit/cd80f430daa7dfe7feeb431ed34f88db5f64aa30

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2021-02-16 Thread Erlend Egeberg Aasland
Erlend Egeberg Aasland added the comment: Thanks, Victor. For PySequence_ITEM, I guess adding a private C version (for example _PySequence_Item) and redirecting the macro to the C version would be acceptable. Ditto for PyHeapType_GET_MEMBERS and PyType_SUPPORTS_WEAKREFS. --

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2021-02-16 Thread Erlend Egeberg Aasland
Change by Erlend Egeberg Aasland : -- pull_requests: +23335 pull_request: https://github.com/python/cpython/pull/24553 ___ Python tracker ___

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2021-02-16 Thread STINNER Victor
STINNER Victor added the comment: > For PyExceptionClass_Name: Is it ok to just remove the macro version (like > with GH-24548)? Yes, I think so. -- ___ Python tracker ___

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2021-02-16 Thread Erlend Egeberg Aasland
Erlend Egeberg Aasland added the comment: For PyExceptionClass_Name: Is it ok to just remove the macro version (like with GH-24548)? -- ___ Python tracker ___

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2021-02-16 Thread STINNER Victor
STINNER Victor added the comment: > New changeset cc54001c2eb3b14320c1667b22602d69c90d5865 by Erlend Egeberg > Aasland in branch 'master': > bpo-40170: Always define PyIter_Check() as a function (GH-24548) For macOS which doesn't use LTO compiler optimization, we added private static inline

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2021-02-16 Thread STINNER Victor
STINNER Victor added the comment: New changeset cc54001c2eb3b14320c1667b22602d69c90d5865 by Erlend Egeberg Aasland in branch 'master': bpo-40170: Always define PyIter_Check() as a function (GH-24548) https://github.com/python/cpython/commit/cc54001c2eb3b14320c1667b22602d69c90d5865

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2021-02-16 Thread Erlend Egeberg Aasland
Change by Erlend Egeberg Aasland : -- pull_requests: +23331 pull_request: https://github.com/python/cpython/pull/24548 ___ Python tracker ___

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2021-02-15 Thread STINNER Victor
STINNER Victor added the comment: New changeset 871eb4237b9be95263ca13ba8856e78344eb9eba by Erlend Egeberg Aasland in branch 'master': bpo-40170: Convert PyDescr_IsData() to static inline function (GH-24535) https://github.com/python/cpython/commit/871eb4237b9be95263ca13ba8856e78344eb9eba

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2021-02-15 Thread STINNER Victor
STINNER Victor added the comment: > Should we strive to fix the cases in Include/internal as well? No. The internal C API access directly to structure members on purpose, for best performances. -- ___ Python tracker

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2021-02-15 Thread Erlend Egeberg Aasland
Erlend Egeberg Aasland added the comment: After GH-24533 and GH-24535, there's (AFAICS) only a handful of cases left. $ grep -r "\->tp_" Include/: Include/internal/pycore_abstract.h:PyNumberMethods *tp_as_number = Py_TYPE(obj)->tp_as_number; Include/internal/pycore_interp.h:unsigned

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2021-02-15 Thread Erlend Egeberg Aasland
Change by Erlend Egeberg Aasland : -- nosy: +erlendaasland nosy_count: 7.0 -> 8.0 pull_requests: +23322 pull_request: https://github.com/python/cpython/pull/24535 ___ Python tracker

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2021-01-18 Thread STINNER Victor
STINNER Victor added the comment: See also bpo-41618: [C API] How many slots of static types should be exposed in PyType_GetSlot(). -- ___ Python tracker ___

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2020-11-24 Thread STINNER Victor
STINNER Victor added the comment: New changeset ed1a5a5baca8f61e9a99c5be3adc16b1801514fe by Hai Shi in branch 'master': bpo-40170: Hide impl detail of Py_TRASHCAN_BEGIN macro (GH-23235) https://github.com/python/cpython/commit/ed1a5a5baca8f61e9a99c5be3adc16b1801514fe --

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2020-11-11 Thread STINNER Victor
STINNER Victor added the comment: New changeset ba2958ed40d284228836735cbed4a155190e0998 by Victor Stinner in branch 'master': bpo-40170: Fix PyType_Ready() refleak on static type (GH-23236) https://github.com/python/cpython/commit/ba2958ed40d284228836735cbed4a155190e0998 --

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2020-11-11 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +22133 pull_request: https://github.com/python/cpython/pull/23236 ___ Python tracker ___

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2020-11-10 Thread hai shi
Change by hai shi : -- pull_requests: +22132 pull_request: https://github.com/python/cpython/pull/23235 ___ Python tracker ___ ___

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2020-11-04 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +22065 pull_request: https://github.com/python/cpython/pull/23153 ___ Python tracker ___

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2020-09-23 Thread STINNER Victor
STINNER Victor added the comment: New changeset 97d15ae1d8411b49b1fcdc0c67c51849dccce9c9 by Victor Stinner in branch 'master': bpo-40170: Use inline _PyType_HasFeature() function (GH-22375) https://github.com/python/cpython/commit/97d15ae1d8411b49b1fcdc0c67c51849dccce9c9 --

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2020-09-23 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +21414 pull_request: https://github.com/python/cpython/pull/22375 ___ Python tracker ___

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2020-07-08 Thread Andy Lester
Change by Andy Lester : -- nosy: -petdance ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2020-07-08 Thread STINNER Victor
STINNER Victor added the comment: > Thanks for doing this. I can confirm the performance regression is fixed and > that clean code is being generated for PyTuple_Check(). Thanks for checking! > BTW, I support your efforts — just wanted to make sure we didn't > unintentionally take a step

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2020-07-08 Thread Raymond Hettinger
Raymond Hettinger added the comment: Thanks for doing this. I can confirm the performance regression is fixed and that clean code is being generated for PyTuple_Check(). BTW, I support your efforts — just wanted to make sure we didn't unintentionally take a step backwards. -- nosy:

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2020-07-08 Thread miss-islington
miss-islington added the comment: New changeset a0a6f1167834c87f12e2eca11dd77143103e7691 by Miss Islington (bot) in branch '3.9': Revert "bpo-40170: PyType_HasFeature() now always calls PyType_GetFlags() (GH-19378)" (GH-21390)

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2020-07-08 Thread STINNER Victor
STINNER Victor added the comment: > New changeset 45ec5b99aefa54552947049086e87ec01bc2fc9a by Victor Stinner in > branch 'master': > bpo-40170: PyType_HasFeature() now always calls PyType_GetFlags() (GH-19378) This change causes performance issues on macOS, see discussion starting at:

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2020-07-08 Thread STINNER Victor
STINNER Victor added the comment: New changeset b26a0db8ea2de3a8a8e4b40e69fc8642c7d7cb68 by Victor Stinner in branch 'master': Revert "bpo-40170: PyType_HasFeature() now always calls PyType_GetFlags() (GH-19378)" (GH-21390)

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2020-07-08 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 6.0 -> 7.0 pull_requests: +20537 pull_request: https://github.com/python/cpython/pull/21391 ___ Python tracker

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2020-07-08 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +20536 pull_request: https://github.com/python/cpython/pull/21390 ___ Python tracker ___

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2020-06-22 Thread STINNER Victor
STINNER Victor added the comment: > PyIter_Check() and PySequence_ITEM() macros access directly PyTypeObject > members and must be converted to opaque functions: (...) PyIter_Check() and PySequence_ITEM() are declared as functions in the limited C API, but overriden with macros in the

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2020-06-22 Thread STINNER Victor
STINNER Victor added the comment: PyIter_Check() and PySequence_ITEM() macros access directly PyTypeObject members and must be converted to opaque functions: #define PyIter_Check(obj) \ (Py_TYPE(obj)->tp_iternext != NULL && \ Py_TYPE(obj)->tp_iternext !=

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2020-06-22 Thread STINNER Victor
STINNER Victor added the comment: > Py_TRASHCAN_BEGIN() access directly PyTypeObject.tp_dealloc (...) currently, > PyType_GetSlot() can only be used on a heap allocated types I created bpo-41073: [C API] PyType_GetSlot() should accept static types. -- versions: +Python 3.10 -Python

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2020-04-15 Thread hai shi
hai shi added the comment: > It never prevented anyone to use a function of the C API :-) Got it. If possible someone uses it, I will try to add a function to repalce it(MAYBE udpate this docs too;) ) -- ___ Python tracker

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2020-04-15 Thread hai shi
Change by hai shi : -- pull_requests: +18889 pull_request: https://github.com/python/cpython/pull/19541 ___ Python tracker ___ ___

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2020-04-15 Thread STINNER Victor
STINNER Victor added the comment: > Looks like this macro not recorded in docs. It never prevented anyone to use a function of the C API :-) -- ___ Python tracker ___

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2020-04-15 Thread hai shi
hai shi added the comment: > Py_TRASHCAN_BEGIN() access directly PyTypeObject.tp_dealloc Looks like this macro not recorded in docs. Do we need using function to replace this macro? -- ___ Python tracker

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2020-04-15 Thread Ronald Oussoren
Ronald Oussoren added the comment: Something else that probably needs attention with the TypeSpec API is subclassing type in an extension when that subclass adds fields to the type object. I use this in PyObjC to (dynamically) create types that have some additional data. I could probably

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2020-04-14 Thread STINNER Victor
STINNER Victor added the comment: On python-dev, Ronald Oussoren asked to add support for the buffer protocol in PyType_FromSpec() and PyTypeSpec API: Ronald: > BTW. This will require growing the PyTypeSpec ABI a little, there are > features you cannot implement using that API for example

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2020-04-14 Thread STINNER Victor
STINNER Victor added the comment: New changeset 675d9a3d7afc767a2818c84da7ba4bf4181dcf26 by Hai Shi in branch 'master': bpo-40170: Convert PyObject_IS_GC() macro to a function (GH-19464) https://github.com/python/cpython/commit/675d9a3d7afc767a2818c84da7ba4bf4181dcf26 --

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2020-04-10 Thread hai shi
Change by hai shi : -- pull_requests: +18819 pull_request: https://github.com/python/cpython/pull/19464 ___ Python tracker ___ ___

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2020-04-10 Thread hai shi
hai shi added the comment: > This macro should be converted to an opaque function Can I try it? -- ___ Python tracker ___ ___

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2020-04-10 Thread STINNER Victor
STINNER Victor added the comment: /* Test if an object has a GC head */ #define PyObject_IS_GC(o) \ (PyType_IS_GC(Py_TYPE(o)) \ && (Py_TYPE(o)->tp_is_gc == NULL || Py_TYPE(o)->tp_is_gc(o))) This macro should be converted to an opaque function. --

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2020-04-07 Thread STINNER Victor
STINNER Victor added the comment: New changeset 307b9d0144e719b016a47fcc43397c070615e01e by Victor Stinner in branch 'master': bpo-40170: Remove PyIndex_Check() macro (GH-19428) https://github.com/python/cpython/commit/307b9d0144e719b016a47fcc43397c070615e01e --

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2020-04-07 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +18786 pull_request: https://github.com/python/cpython/pull/19428 ___ Python tracker ___

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2020-04-07 Thread STINNER Victor
STINNER Victor added the comment: Hum, once most changes will land, maybe it would be worth it to document them at: https://docs.python.org/dev/whatsnew/3.9.html#build-and-c-api-changes -- ___ Python tracker

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2020-04-07 Thread STINNER Victor
STINNER Victor added the comment: New changeset a15e260b708a98edaba86a2aa663c3f6b2abc964 by Victor Stinner in branch 'master': bpo-40170: Add _PyIndex_Check() internal function (GH-19426) https://github.com/python/cpython/commit/a15e260b708a98edaba86a2aa663c3f6b2abc964 --

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2020-04-07 Thread STINNER Victor
STINNER Victor added the comment: New changeset 45ec5b99aefa54552947049086e87ec01bc2fc9a by Victor Stinner in branch 'master': bpo-40170: PyType_HasFeature() now always calls PyType_GetFlags() (GH-19378) https://github.com/python/cpython/commit/45ec5b99aefa54552947049086e87ec01bc2fc9a

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2020-04-07 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +18784 pull_request: https://github.com/python/cpython/pull/19426 ___ Python tracker ___

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2020-04-07 Thread STINNER Victor
STINNER Victor added the comment: New changeset ef5c615f5ae72c4f6979159c94da46afefbfab9a by Victor Stinner in branch 'master': bpo-40170: Convert PyObject_CheckBuffer() macro to a function (GH-19376) https://github.com/python/cpython/commit/ef5c615f5ae72c4f6979159c94da46afefbfab9a

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2020-04-07 Thread STINNER Victor
STINNER Victor added the comment: New changeset 9205520d8c43488696d66cbdd9aefbb21871c508 by Victor Stinner in branch 'master': bpo-40170: PyObject_NEW() becomes an alias to PyObject_New() (GH-19379) https://github.com/python/cpython/commit/9205520d8c43488696d66cbdd9aefbb21871c508

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2020-04-06 Thread STINNER Victor
STINNER Victor added the comment: > Just checked - seems to be SPECIFIC to xlc-v16 as neither xlv-v11 nor xlc-v13 > have any issues building. That sounds like an AIX specific issue. Please open a separated issue. -- ___ Python tracker

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2020-04-06 Thread STINNER Victor
STINNER Victor added the comment: > It should use PyType_GetSlot() Oh. It seems like currently, PyType_GetSlot() can only be used on a heap allocated types :-( The function starts with: if (!PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE) || slot < 0) { PyErr_BadInternalCall();

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2020-04-06 Thread STINNER Victor
STINNER Victor added the comment: Py_TRASHCAN_BEGIN() access directly PyTypeObject.tp_dealloc: #define Py_TRASHCAN_BEGIN(op, dealloc) \ Py_TRASHCAN_BEGIN_CONDITION(op, \ Py_TYPE(op)->tp_dealloc == (destructor)(dealloc)) It should use PyType_GetSlot() or a new getter function (to

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2020-04-06 Thread Michael Felt
Michael Felt added the comment: Just checked - seems to be SPECIFIC to xlc-v16 as neither xlv-v11 nor xlc-v13 have any issues building. -- ___ Python tracker ___

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2020-04-06 Thread Michael Felt
Michael Felt added the comment: Just manually verified that PR19377, when compiled against xlc - crashes during make: rm -f libpython3.9d.a ar rcs libpython3.9d.a Modules/getbuildinfo.o Parser/acceler.o Parser/grammar1.o Parser/listnode.o Parser/node.o Parser/parser.o

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2020-04-06 Thread STINNER Victor
STINNER Victor added the comment: New changeset 38aefc585f60a77d66f4fbe5a37594a488b53474 by Victor Stinner in branch 'master': bpo-40170: PyObject_GET_WEAKREFS_LISTPTR() becomes a function (GH-19377) https://github.com/python/cpython/commit/38aefc585f60a77d66f4fbe5a37594a488b53474

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2020-04-04 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +18741 pull_request: https://github.com/python/cpython/pull/19379 ___ Python tracker ___

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2020-04-04 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +18740 pull_request: https://github.com/python/cpython/pull/19378 ___ Python tracker ___

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2020-04-04 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +18739 pull_request: https://github.com/python/cpython/pull/19377 ___ Python tracker ___

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2020-04-04 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +18738 pull_request: https://github.com/python/cpython/pull/19376 ___ Python tracker ___

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2020-04-04 Thread STINNER Victor
Change by STINNER Victor : -- keywords: +patch pull_requests: +18737 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19375 ___ Python tracker ___

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2020-04-04 Thread STINNER Victor
STINNER Victor added the comment: Macros and static inline functions of the public C API which access directly PyTypeObject fields. There may be more. #define _PyObject_SIZE(typeobj) ( (typeobj)->tp_basicsize ) static inline vectorcallfunc PyVectorcall_Function(PyObject *callable) { ...

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2020-04-04 Thread hai shi
Change by hai shi : -- nosy: +shihai1991 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2020-04-03 Thread Andy Lester
Change by Andy Lester : -- nosy: +petdance ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2020-04-03 Thread Dong-hee Na
Change by Dong-hee Na : -- nosy: +corona10 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2020-04-03 Thread STINNER Victor
New submission from STINNER Victor : Leaking the PyTypeObject structure in the C API indirectly causes ABI issue (especially for statically allocated types), cause practical issues when old fields are removed and new fields are added (ex: tp_vectorcall addition and tp_print removal caused a