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-111506: Add _Py_OPAQUE_PYOBJECT to hide PyObject layout & related API by encukou · Pull Request #136505 · python/cpython Conversation
|
|
We can also test this (with a workaround/hack in the test for the missing part). |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
🤖 New build scheduled with the buildbot fleet by @encukou for commit 33d9ae7 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F136505%2Fmerge If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
The tests aren't that straightforward, but the workaround can still be removed if we either scrap the “opaque PyObject” idea or implement PEP 793. |
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 like the overall approach of the _Py_OPAQUE_PYOBJECT macro. I'm fine with testing it in test_cext.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| # Test with _Py_OPAQUE_PYOBJECT | ||
| self.check_build('_test_limited_opaque_cext', limited=True, opaque=True) | ||
|
|
||
| def check_build(self, extension_name, std=None, limited=False, opaque=False): |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I suggest to rename "opaque" to "opaque_pyobject" (also in _check_build).
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| std = os.environ.get("CPYTHON_TEST_STD", "") | ||
| module_name = os.environ["CPYTHON_TEST_EXT_NAME"] | ||
| limited = bool(os.environ.get("CPYTHON_TEST_LIMITED", "")) | ||
| opaque = bool(os.environ.get("CPYTHON_TEST_OPAQUE_PYOBJECT", "")) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I suggest to rename opaque to opaque_pyobject.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| # Define _Py_OPAQUE_PYOBJECT macro | ||
| if opaque: | ||
| version = sys.hexversion |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
version is not used, it can be removed.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…lated API (pythonGH-136505) Allow Py_LIMITED_API for (Py_GIL_DISABLED && _Py_OPAQUE_PYOBJECT) API that's removed when _Py_OPAQUE_PYOBJECT is defined: - PyObject_HEAD - _PyObject_EXTRA_INIT - PyObject_HEAD_INIT - PyObject_VAR_HEAD - struct _object (i.e. PyObject) (opaque) - struct PyVarObject (opaque) - Py_SIZE - Py_SET_TYPE - Py_SET_SIZE - PyModuleDef_Base (opaque) - PyModuleDef_HEAD_INIT - PyModuleDef (opaque) - _Py_IsImmortal - _Py_IsStaticImmortal Note that the `_Py_IsImmortal` removal (and a few other issues) means _Py_OPAQUE_PYOBJECT only works with limited API 3.14+ now. Co-authored-by: Victor Stinner <[email protected]>
…lated API (pythonGH-136505) Allow Py_LIMITED_API for (Py_GIL_DISABLED && _Py_OPAQUE_PYOBJECT) API that's removed when _Py_OPAQUE_PYOBJECT is defined: - PyObject_HEAD - _PyObject_EXTRA_INIT - PyObject_HEAD_INIT - PyObject_VAR_HEAD - struct _object (i.e. PyObject) (opaque) - struct PyVarObject (opaque) - Py_SIZE - Py_SET_TYPE - Py_SET_SIZE - PyModuleDef_Base (opaque) - PyModuleDef_HEAD_INIT - PyModuleDef (opaque) - _Py_IsImmortal - _Py_IsStaticImmortal Note that the `_Py_IsImmortal` removal (and a few other issues) means _Py_OPAQUE_PYOBJECT only works with limited API 3.14+ now. Co-authored-by: Victor Stinner <[email protected]>
…lated API (pythonGH-136505) Allow Py_LIMITED_API for (Py_GIL_DISABLED && _Py_OPAQUE_PYOBJECT) API that's removed when _Py_OPAQUE_PYOBJECT is defined: - PyObject_HEAD - _PyObject_EXTRA_INIT - PyObject_HEAD_INIT - PyObject_VAR_HEAD - struct _object (i.e. PyObject) (opaque) - struct PyVarObject (opaque) - Py_SIZE - Py_SET_TYPE - Py_SET_SIZE - PyModuleDef_Base (opaque) - PyModuleDef_HEAD_INIT - PyModuleDef (opaque) - _Py_IsImmortal - _Py_IsStaticImmortal Note that the `_Py_IsImmortal` removal (and a few other issues) means _Py_OPAQUE_PYOBJECT only works with limited API 3.14+ now. Co-authored-by: Victor Stinner <[email protected]>
…lated API (pythonGH-136505) Allow Py_LIMITED_API for (Py_GIL_DISABLED && _Py_OPAQUE_PYOBJECT) API that's removed when _Py_OPAQUE_PYOBJECT is defined: - PyObject_HEAD - _PyObject_EXTRA_INIT - PyObject_HEAD_INIT - PyObject_VAR_HEAD - struct _object (i.e. PyObject) (opaque) - struct PyVarObject (opaque) - Py_SIZE - Py_SET_TYPE - Py_SET_SIZE - PyModuleDef_Base (opaque) - PyModuleDef_HEAD_INIT - PyModuleDef (opaque) - _Py_IsImmortal - _Py_IsStaticImmortal Note that the `_Py_IsImmortal` removal (and a few other issues) means _Py_OPAQUE_PYOBJECT only works with limited API 3.14+ now. Co-authored-by: Victor Stinner <[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.