GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||
GeezerVison is showing github.com — gh-116417: Add _testlimitedcapi C extension by vstinner · Pull Request #116419 · python/cpython Conversation
|
|
@erlend-aasland @encukou @sobolevn @colesbury: What do you think of this change? (See the issue for the rationale.) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
If we land this change, should we move tests which don't use the non-limited C API (tests only using the limited C API) to _testlimitedapi? This change should be backported to 3.11 and 3.12 branches to ease backport of future changes. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This seems like a good idea to me.
#include "pyconfig.h" can be removed from vectorcall_limited.c and heaptype_relative.c now that it's part of parts.hheaptype_relative.c can also remove the Py_LIMITED_API define now that it's defined in parts.h.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Can we remove |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Fixed: nicely spotted for remaining code in heaptype_relative.c. I had a lot of build issues to build the new C extension properly on Linux and Windows, and then I forgot these lines.
I don't think that it's a test, but more an example to write code using the limited C API. I started with the comment: /* Use this file as a template to start implementing a module that also declares object types. All occurrences of 'Xxo' should be changed cc @encukou |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@colesbury: I addressed your remarks and tests now pass. You can review the updated PR ;-) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This looks like a good idea, thank you!
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I'd like it if you could create an entry for this module in configure.ac; that way it is easier to see if this module is enabled or not. Relevant output from sample ./configure and make invocations:
The following modules are *disabled* in configure script:
_ctypes_test _testbuffer _testcapi
_testclinic _testclinic_limited _testexternalinspection
_testimportmultiple _testinternalcapi _testmultiphase
_testsinglephase _xxtestfuzz xxsubtype
checking for stdlib extension module _testcapi... disabled
checking for stdlib extension module _testclinic... disabled
checking for stdlib extension module _testclinic_limited... disabled
checking for stdlib extension module _testinternalcapi... disabled
checking for stdlib extension module _testbuffer... disabled
checking for stdlib extension module _testimportmultiple... disabled
checking for stdlib extension module _testmultiphase... disabled
checking for stdlib extension module _testsinglephase... disabled
checking for stdlib extension module _testexternalinspection... disabled
If you "hide" this new extension module behind the _testcapi module, it will not show up in these outputs.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sure! It's done. Example: The test extension is now disabled as expected. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Co-authored-by: Erlend E. Aasland <[email protected]>
|
Thanks! On more nit :) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
It's a nice change; it makes sense to have this as a separate test module IMO. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks for your helpful reviews! I merged my PR. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Backporting this change to Python 3.12 looks non trivial, I get many conflicts: The split of |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Add a new C extension "_testlimitedcapi" which is only built with the limited C API. Move heaptype_relative.c and vectorcall_limited.c from Modules/_testcapi/ to Modules/_testlimitedcapi/. * configure: add _testlimitedcapi test extension. * Update generate_stdlib_module_names.py. * Update make check-c-globals. Co-authored-by: Erlend E. Aasland <[email protected]>
Add a new C extension "_testlimitedcapi" which is only built with the limited C API. Move heaptype_relative.c and vectorcall_limited.c from Modules/_testcapi/ to Modules/_testlimitedcapi/. * configure: add _testlimitedcapi test extension. * Update generate_stdlib_module_names.py. * Update make check-c-globals. Co-authored-by: Erlend E. Aasland <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.