summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_dict.py
Commit message (Collapse)AuthorAgeFilesLines
* gh-116303: Skip tests if C recursion limit is unavailable (GH-117368)Erlend E. Aasland2024-04-081-2/+2
| | | | | The test suite fetches the C recursion limit from the _testcapi extension module. Test extension modules can be disabled using the --disable-test-modules configure option.
* GH-91079: Rename C_RECURSION_LIMIT to Py_C_RECURSION_LIMIT (#108507)Victor Stinner2023-09-081-2/+2
| | | | | | | Symbols of the C API should be prefixed by "Py_" to avoid conflict with existing names in 3rd party C extensions on "#include <Python.h>". test.pythoninfo now logs Py_C_RECURSION_LIMIT constant and other _testcapi and _testinternalcapi constants.
* gh-106320: Remove private _PyDict functions (#108449)Victor Stinner2023-08-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Move private 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 structure to the internal C API. Move dict_getitem_knownhash() function from _testcapi to the _testinternalcapi extension. Update test_capi.test_dict for this change.
* GH-107263: Increase C stack limit for most functions, except ↵Mark Shannon2023-08-041-2/+2
| | | | | | `_PyEval_EvalFrameDefault()` (GH-107535) * Set C recursion limit to 1500, set cost of eval loop to 2 frames, and compiler mutliply to 2.
* gh-94808: Improve coverage of dictresize (GH-100619)tqxia2022-12-311-0/+15
|
* bpo-46198: rename duplicate tests and remove unused code (GH-30297)Nikita Sobolev2022-03-101-1/+1
|
* bpo-40116: dict: Add regression test for iteration order. (GH-31550)Inada Naoki2022-03-031-0/+17
|
* bpo-45609: Specialize STORE_SUBSCR (GH-29242)Dennis Sweeney2021-11-191-0/+8
| | | | | * Specialize STORE_SUBSCR for list[int], and dict[object] * Adds _PyDict_SetItem_Take2 which consumes references to the key and values.
* bpo-45668: Fix PGO tests without test extensions (GH-29315)Christian Heimes2021-11-011-1/+3
|
* bpo-45340: Don't create object dictionaries unless actually needed (GH-28802)Mark Shannon2021-10-131-3/+2
| | | | | | | | | | | | | | * Never change types' cached keys. It could invalidate inline attribute objects. * Lazily create object dictionaries. * Update specialization of LOAD/STORE_ATTR. * Don't update shared keys version for deletion of value. * Update gdb support to handle instance values. * Rename SPLIT_KEYS opcodes to INSTANCE_VALUE.
* Fix typos in the Lib directory (GH-28775)Christian Clauss2021-10-061-2/+2
| | | | | Fix typos in the Lib directory as identified by codespell. Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
* bpo-40116: Add insertion order bit-vector to dict values to allow dicts to ↵Mark Shannon2021-10-061-36/+1
| | | | share keys more freely. (GH-28520)
* bpo-24275: Don't downgrade unicode-only dicts to mixed on lookups (GH-25186)Hristo Venev2021-04-291-0/+100
|
* bpo-42536: GC track recycled tuples (GH-23623)Brandt Bucher2020-12-051-0/+19
| | | | | | | | | | | | | | | | Several built-in and standard library types now ensure that their internal result tuples are always tracked by the garbage collector: - collections.OrderedDict.items - dict.items - enumerate - functools.reduce - itertools.combinations - itertools.combinations_with_replacement - itertools.permutations - itertools.product - itertools.zip_longest - zip Previously, they could have become untracked by a prior garbage collection.
* bpo-40890: Add `mapping` property to dict views (GH-20749)Dennis Sweeney2020-06-121-0/+20
|
* bpo-40889: Optimize dict.items() ^ dict.items() (GH-20718)Dennis Sweeney2020-06-101-0/+10
|
* bpo-40489: Add test case for dict contain use after free (GH-19906)Dong-hee Na2020-05-041-0/+13
|
* bpo-36144: Dictionary Union (PEP 584) (#12088)Brandt Bucher2020-02-251-0/+32
|
* bpo-38588: Fix possible crashes in dict and list when calling ↵Dong-hee Na2019-12-311-1/+11
| | | | | | PyObject_RichCompareBool (GH-17734) Take strong references before calling PyObject_RichCompareBool to protect against the case where the object dies during the call.
* bpo-38525: Fix a segmentation fault when using reverse iterators of empty ↵Dong-hee Na2019-10-191-0/+25
| | | | | dict (GH-16846) The reverse iterator for empty dictionaries was not handling correctly shared-key dictionaries.
* bpo-36473: add maximum iteration check for dict .values() and .items() ↵Thomas Perl2019-04-021-1/+19
| | | | (GH-12619)
* bpo-36452: dictiter: track maximum iteration count (GH-12596)Thomas Perl2019-03-281-0/+9
|
* Include the highest pickle protocol in a couple of tests. (GH-10735)Zackery Spytz2018-11-271-1/+1
| | | | | test_reduce_ex() in test_array.py and test_reversevaluesiterator_pickling() in test_dict.py weren't using the highest pickle protocol.
* bpo-33462: Add __reversed__ to dict and dict views (GH-6827)Rémi Lapeyre2018-11-061-3/+66
|
* bpo-34320: Fix dict(o) didn't copy order of dict subclass (GH-8624)INADA Naoki2018-09-261-0/+30
| | | | | | | When dict subclass overrides order (`__iter__()`, `keys()`, and `items()`), `dict(o)` should use it instead of dict ordering. https://bugs.python.org/issue34320
* Test dict values iterator pickling with pickle.HIGHEST_PROTOCOL. (GH-9052)Sergey Fedoseev2018-09-101-1/+1
|
* bpo-31179: Make dict.copy() up to 5.5 times faster. (#3067)Yury Selivanov2018-01-221-2/+48
|
* bpo-32137: The repr of deeply nested dict now raises a RecursionError (#4570)Serhiy Storchaka2017-12-031-0/+6
| | | | | instead of crashing due to a stack overflow. This perhaps will fix similar problems in other extension types.
* bpo-27945: Fixed various segfaults with dict. (#1657)Serhiy Storchaka2017-05-201-0/+85
| | | | Based on patches by Duane Griffin and Tim Mitchell.
* Fix a memory leak in split-table dictionariesVictor Stinner2016-12-151-0/+30
| | | | | | | Issue #28147: Fix a memory leak in split-table dictionaries: setattr() must not convert combined table into split table. Patch written by INADA Naoki.
* Issue #28123: _PyDict_GetItem_KnownHash() now can raise an exception asSerhiy Storchaka2016-11-061-0/+31
| | | | PyDict_GetItemWithError(). Patch by Xiang Zhang.
* Issue #28583: PyDict_SetDefault didn't combine split table when needed.INADA Naoki2016-11-021-0/+17
| | | | Patch by Xiang Zhang.
* Fix _PyDict_Pop() on pending keyVictor Stinner2016-09-131-0/+9
| | | | | | | Issue #28120: Fix dict.pop() for splitted dictionary when trying to remove a "pending key" (Not yet inserted in split-table). Patch by Xiang Zhang.
* Fix SystemError in compact dictVictor Stinner2016-09-101-0/+69
| | | | | | | | | Issue #28040: Fix _PyDict_DelItem_KnownHash() and _PyDict_Pop(): convert splitted table to combined table to be able to delete the item. Write an unit test for the issue. Patch by INADA Naoki.
* Issue #27125: Merge typo fixes from 3.5Martin Panter2016-05-301-1/+1
|\
| * Issue #27125: Remove duplicated words from documentation and commentsMartin Panter2016-05-301-1/+1
| |
* | Issue #26494: Fixed crash on iterating exhausting iterators.Serhiy Storchaka2016-03-301-0/+6
|\ \ | |/ | | | | | | | | Affected classes are generic sequence iterators, iterators of str, bytes, bytearray, list, tuple, set, frozenset, dict, OrderedDict, corresponding views and os.scandir() iterator.
| * Issue #26494: Fixed crash on iterating exhausting iterators.Serhiy Storchaka2016-03-301-0/+6
| | | | | | | | | | | | Affected classes are generic sequence iterators, iterators of str, bytes, bytearray, list, tuple, set, frozenset, dict, OrderedDict, corresponding views and os.scandir() iterator.
* | Cleanup test_dictVictor Stinner2016-01-231-5/+8
|/ | | | | | * Write one import per line * Sort imports by name * Add an empty line: 2 empty lines between code blocks at the module level (PEP 8)
* Issue #25523: Merge a-to-an corrections from 3.4.Serhiy Storchaka2015-11-021-1/+1
|\
| * Issue #25523: Further a-to-an corrections.Serhiy Storchaka2015-11-021-1/+1
| |
* | merge 3.4 (#24407)Benjamin Peterson2015-07-051-0/+14
|\ \ | |/
| * merge 3.3 (#24407)Benjamin Peterson2015-07-051-0/+14
| |\
| | * protect against mutation of the dict during insertion (closes #24407)Benjamin Peterson2015-07-051-0/+15
| | |
* | | Issue #21741: Update 147 test modules to use test discovery.Zachary Ware2015-04-131-8/+1
|/ / | | | | | | | | | | | | I have compared output between pre- and post-patch runs of these tests to make sure there's nothing missing and nothing broken, on both Windows and Linux. The only differences I found were actually tests that were previously *not* run.
* | Issue #22777: Test pickling with all protocols.Serhiy Storchaka2014-12-151-47/+50
| |
* | Issue #22653: Fix an assertion failure in debug mode when doing a reentrant ↵Antoine Pitrou2014-10-171-0/+29
|/ | | | dict insertion in debug mode.
* #19166: use an unused var in a test. Patch by Vajrasky Kok.Ezio Melotti2013-10-051-0/+3
|
* merge 3.2 (#16345)Benjamin Peterson2012-10-311-0/+8
|\
| * only fast-path fromkeys() when the constructor returns a empty dict (closes ↵Benjamin Peterson2012-10-311-0/+8
| | | | | | | | #16345)