| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Move private _PyDict functions to the internal C API (pycore_dict.h): * _PyDictView_Intersect() * _PyDictView_New() * _PyDict_ContainsId() * _PyDict_DelItemId() * _PyDict_DelItem_KnownHash() * _PyDict_GetItemIdWithError() * _PyDict_GetItem_KnownHash() * _PyDict_HasSplitTable() * _PyDict_NewPresized() * _PyDict_Next() * _PyDict_Pop() * _PyDict_SetItemId() * _PyDict_SetItem_KnownHash() * _PyDict_SizeOf() No longer export most of these functions. Move also the _PyDictViewObject to the internal C API. Move dict_getitem_knownhash() function from _testcapi to the _testinternalcapi extension. Update test_capi.test_dict for this move.
|
@vstinner In this PR the method _PyDict_NewPresized was moved to the internal API. According to https://devguide.python.org/developer-workflow/c-api/#with-the-extern-keyword the method should still be available for stdlib extensions. I am using the method in an extension module #91610, but the build is failing since this PR was merged with error message Error: _copy failed to import: /home/runner/work/cpython/cpython-builddir/build/lib.linux-x86_64-3.13-pydebug/_copy.cpython-313d-x86_64-linux-gnu.so: undefined symbol: _PyDict_NewPresized (but the build is successful for Windows platforms). I added the correct header file #include "pycore_dict.h" and macros Py_BUILD_CORE_MODULE and Py_BUILD_CORE_BUILTIN. What else needs to be done to make use of _PyDict_NewPresized? |
Sorry, something went wrong.
If you want to use this function in a stdlib extension, you should replace extern with PyAPI_FUNC(). It's required to be able to use the function in extensions built as shared libraries. |
Sorry, something went wrong.
…have been public right away. See python#108449
…have been public right away. See python#108449
…have been public right away. See python#108449
…have been public right away. See python#108449
…have been public right away. See python#108449
…have been public right away. See python#108449
| Back | FazBrowse Home | New Git URL |
Move private _PyDict functions to the internal C API (pycore_dict.h):
No longer export most of these functions.
Move also the _PyDictViewObject to the internal C API.
Move dict_getitem_knownhash() function from _testcapi to the _testinternalcapi extension. Update test_capi.test_dict for this move.