summaryrefslogtreecommitdiffstats
path: root/Include/cpython/dictobject.h
Commit message (Collapse)AuthorAgeFilesLines
* gh-102381: don't call watcher callback with dead object (#102382)Carl Meyer2023-03-081-8/+13
| | | Co-authored-by: T. Wouters <thomas@python.org>
* gh-101152: Implement PEP 699 (GH-101193)ram vikram singh2023-01-241-0/+4
| | | | Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> Co-authored-by: Ken Jin <kenjin@python.org>
* gh-91052: Add PyDict_Unwatch for unwatching a dictionary (#98055)Carl Meyer2022-10-081-0/+1
|
* GH-91052: Add C API for watching dictionaries (GH-31787)Carl Meyer2022-10-071-0/+23
|
* GH-95245: Store object values and dict pointers in single tagged pointer. ↵Mark Shannon2022-08-011-3/+0
| | | | (GH-95278)
* GH-92678: Expose managed dict clear and visit functions (#95246)Mark Shannon2022-07-251-0/+3
|
* gh-89653: PEP 670: Macros always cast arguments in cpython/ (#93766)Victor Stinner2022-06-131-3/+1
| | | | Header files in the Include/cpython/ are only included if the Py_LIMITED_API macro is not defined.
* gh-92781: Avoid mixing declarations and code in C API (#92783)Victor Stinner2022-05-151-1/+2
| | | | | Avoid mixing declarations and code in the C API to fix the compiler warning: "ISO C90 forbids mixed declarations and code" [-Werror=declaration-after-statement].
* gh-89653: PEP 670: Convert PyDict_GET_SIZE() macro to function (#92695)Victor Stinner2022-05-111-1/+9
| | | The limited C API version 3.12 no longer casts the argument.
* bpo-45316: Move private PyDict functions to internal C API (GH-31577)Victor Stinner2022-02-251-14/+0
| | | | | | | | | | | | | | | | | Move the following private unexported functions to the internal C API headers: * _PyDictKeys_GetVersionForCurrentState() * _PyDictKeys_StringLookup() * _PyDict_FromKeys() * _PyDict_GetItemHint() * _PyDict_KeysSize() * _PyDict_LoadGlobal() * _PyDict_NewKeysForClass() * _PyDict_Pop_KnownHash() * _PyDict_SetItem_Take2() * _PyObjectDict_SetItem() * _PyObject_MakeDictFromInstanceAttributes() * _Py_dict_lookup()
* bpo-45459: C API uses type names rather than structure names (GH-31528)Victor Stinner2022-02-241-4/+4
| | | | Thanks to the new pytypedefs.h, it becomes to use type names like PyObject rather like structure names like "struct _object".
* bpo-46541: Replace core use of _Py_IDENTIFIER() with statically initialized ↵Eric Snow2022-02-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | global objects. (gh-30928) We're no longer using _Py_IDENTIFIER() (or _Py_static_string()) in any core CPython code. It is still used in a number of non-builtin stdlib modules. The replacement is: PyUnicodeObject (not pointer) fields under _PyRuntimeState, statically initialized as part of _PyRuntime. A new _Py_GET_GLOBAL_IDENTIFIER() macro facilitates lookup of the fields (along with _Py_GET_GLOBAL_STRING() for non-identifier strings). https://bugs.python.org/issue46541#msg411799 explains the rationale for this change. The core of the change is in: * (new) Include/internal/pycore_global_strings.h - the declarations for the global strings, along with the macros * Include/internal/pycore_runtime_init.h - added the static initializers for the global strings * Include/internal/pycore_global_objects.h - where the struct in pycore_global_strings.h is hooked into _PyRuntimeState * Tools/scripts/generate_global_objects.py - added generation of the global string declarations and static initializers I've also added a --check flag to generate_global_objects.py (along with make check-global-objects) to check for unused global strings. That check is added to the PR CI config. The remainder of this change updates the core code to use _Py_GET_GLOBAL_IDENTIFIER() instead of _Py_IDENTIFIER() and the related _Py*Id functions (likewise for _Py_GET_GLOBAL_STRING() instead of _Py_static_string()). This includes adding a few functions where there wasn't already an alternative to _Py*Id(), replacing the _Py_Identifier * parameter with PyObject *. The following are not changed (yet): * stop using _Py_IDENTIFIER() in the stdlib modules * (maybe) get rid of _Py_IDENTIFIER(), etc. entirely -- this may not be doable as at least one package on PyPI using this (private) API * (maybe) intern the strings during runtime init https://bugs.python.org/issue46541
* Fix typos in the Include directory (GH-28745)Christian Clauss2021-10-061-1/+1
|
* bpo-40116: Add insertion order bit-vector to dict values to allow dicts to ↵Mark Shannon2021-10-061-1/+2
| | | | share keys more freely. (GH-28520)
* bpo-45219: Factor dictkey indexing (GH-28389)Mark Shannon2021-09-171-1/+3
|
* bpo-44206: Add a version number to dictionary keys (GH-26333)Mark Shannon2021-05-281-0/+4
| | | | | | | | * Store log2(size) instead of size in dict-keys. * Use enum instead of function pointer to record kind of keys. * Add version number to dict keys.
* bpo-42006: Stop using PyDict_GetItem, PyDict_GetItemString and ↵Serhiy Storchaka2020-10-261-2/+2
| | | | | | | | | | | _PyDict_GetItemId. (GH-22648) These functions are considered not safe because they suppress all internal errors and can return wrong result. PyDict_GetItemString and _PyDict_GetItemId can also silence current exception in rare cases. Remove no longer used _PyDict_GetItemId. Add _PyDict_ContainsId and rename _PyDict_Contains into _PyDict_Contains_KnownHash.
* bpo-42093: Add opcode cache for LOAD_ATTR (GH-22803)Pablo Galindo2020-10-201-0/+1
|
* bpo-41845: Move PyObject_GenericGetDict() back into the limited API (GH22646)Zackery Spytz2020-10-191-1/+0
| | | | It was moved out of the limited API in 7d95e4072169911b228c9e42367afb5f17fd3db0. This change re-enables it from 3.10, to avoid generating invalid extension modules for earlier versions.
* bpo-39583: Remove superfluous "extern C" bits from Include/cpython/*.h ↵Skip Montanaro2020-06-011-8/+0
| | | | (GH-18413)
* bpo-40428: Remove PyTuple_ClearFreeList() function (GH-19769)Victor Stinner2020-04-291-2/+0
| | | | | | | | | | | | | | | | | | | Remove the following function from the C API: * PyAsyncGen_ClearFreeLists() * PyContext_ClearFreeList() * PyDict_ClearFreeList() * PyFloat_ClearFreeList() * PyFrame_ClearFreeList() * PyList_ClearFreeList() * PySet_ClearFreeList() * PyTuple_ClearFreeList() Make these functions private, move them to the internal C API and change their return type to void. Call explicitly PyGC_Collect() to free all free lists. Note: PySet_ClearFreeList() did nothing.
* bpo-35459: Use PyDict_GetItemWithError() instead of PyDict_GetItem(). (GH-11112)Serhiy Storchaka2019-02-251-0/+1
|
* bpo-35134: Create Include/cpython/dictobject.h (GH-10732)Victor Stinner2018-11-261-0/+93
* Move dictobject.h code surrounded by "#ifndef Py_LIMITED_API" to a new Include/cpython/dictobject.h header file. * Add PyAPI_FUNC() to _PyDictView_New(). * Reorganize dictobject.h: move views and iterators at the end.