Commit Graph

365 Commits

Author SHA1 Message Date
Raymond Hettinger
6692f01c91 merge 2016-09-18 21:46:08 -07:00
Victor Stinner
611b0fa94c Add _PyDict_CheckConsistency()
Issue #28127: Add a function to check that a dictionary remains consistent
after any change.

By default, tables are not checked, only basic attributes. Define DEBUG_PYDICT
(ex: gcc -D DEBUG_PYDICT) to also check dictionary "content".
2016-09-14 15:02:01 +02:00
Victor Stinner
d0ad11f6b4 Fix _PyDict_Pop() on pending key
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.
2016-09-13 16:56:38 +02:00
Victor Stinner
9926480b6a Issue #28040: Cleanup find_empty_slot()
find_empty_slot() only supports combined dict
2016-09-13 09:38:29 +02:00
Victor Stinner
3c336c5915 Issue #28077: find_empty_slot() only supports combined dict 2016-09-12 14:17:40 +02:00
Serhiy Storchaka
473e0e4dba Fixed compiler warnings in compact dict implementation on 32-bit platforms. 2016-09-10 21:34:43 +03:00
Victor Stinner
990397ef1e dictobject.c: explain why stringlib is used 2016-09-09 20:22:59 -07:00
Victor Stinner
78601a38c2 Fix SystemError in compact dict
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.
2016-09-09 19:28:36 -07:00
Berker Peksag
71c01d43a7 Issue #28033: Fix typo in dictobject.c
Patch by Wesley Emeneker.
2016-09-09 03:57:23 +03:00
Benjamin Peterson
3c569295d6 do not worry about 64-bit dict sizes on 32-bit platforms 2016-09-08 13:16:41 -07:00
Victor Stinner
3b6a6b4215 Add a new private version to the builtin dict type
Issue #26058: Add a new private version to the builtin dict type, incremented
at each dictionary creation and at each dictionary change.

Implementation of the PEP 509.
2016-09-08 12:51:24 -07:00
Benjamin Peterson
186122ead2 access dk_indices through a union 2016-09-08 12:20:12 -07:00
Victor Stinner
a4348cc1be Add documentation to the dict implementation
Issue #27350.
2016-09-08 12:01:25 -07:00
Victor Stinner
58f7c5a955 Reindeint DK_xxx macros
Issue #27350.
2016-09-08 11:37:36 -07:00
Victor Stinner
208857ec33 dk_get_index/dk_set_index uses a type indices variable
Issue #27350.
2016-09-08 11:35:46 -07:00
Victor Stinner
dee6e252cc Split lookdict_unicode_nodummy() assertion to debug
Issue #27350.
2016-09-08 11:16:07 -07:00
Victor Stinner
71211e3386 Add assertions to dk_set_index()
Issue #27350.
2016-09-08 10:52:46 -07:00
Benjamin Peterson
003f059b3a link to canonical blogspot 2016-09-08 10:14:31 -07:00
Benjamin Peterson
7322225a57 use native inline instead of Py_LOCAL_INLINE 2016-09-08 09:58:47 -07:00
Benjamin Peterson
f0acae2d3c rearrange to make gcc happy 2016-09-08 09:50:08 -07:00
Victor Stinner
98ee9d5b73 Add Py_MEMBER_SIZE macro
Issue #27350: use Py_MEMBER_SIZE() macro to get the size of
PyDictKeyEntry.dk_indices, rather than hardcoding 8.
2016-09-08 09:33:56 -07:00
Victor Stinner
742da040db Implement compact dict
Issue #27350: `dict` implementation is changed like PyPy. It is more compact
and preserves insertion order.

_PyDict_Dummy() function has been removed.

Disable test_gdb: python-gdb.py is not updated yet to the new structure of
compact dictionaries (issue #28023).

Patch written by INADA Naoki.
2016-09-07 17:40:12 -07:00
Benjamin Peterson
55f445282d remove memory indirections in dict_traverse (closes #27956) 2016-09-05 12:12:59 -07:00
R David Murray
ce85acff3a Merge: #20647: Update dictobject.c comments to account for randomized string hashes. 2016-07-10 12:40:03 -04:00
R David Murray
537ad7ad9f #20647: Update dictobject.c comments to account for randomized string hashes.
Patch by Jaysinh Shukla.
2016-07-10 12:33:18 -04:00