Commit Graph

32 Commits

Author SHA1 Message Date
Serhiy Storchaka d2962f145a Issue #25949: __dict__ for an OrderedDict instance is now created only when
needed.
2016-02-08 16:39:05 +02:00
Serhiy Storchaka d205d0145c Issue #25935: Garbage collector now breaks reference loops with OrderedDict. 2016-01-19 14:46:25 +02:00
Serhiy Storchaka 0ce7a3a34c Issue #25914: Fixed and simplified OrderedDict.__sizeof__. 2015-12-22 08:16:18 +02:00
Serhiy Storchaka 5c4064e8bd Issue #25421: __sizeof__ methods of builtin types now use dynamic basic size.
This allows sys.getsize() to work correctly with their subclasses with
__slots__ defined.
2015-12-19 20:05:25 +02:00
Serhiy Storchaka 19a70e7f5d Issue #25462: The hash of the key now is calculated only once in most
operations in C implementation of OrderedDict.
2015-11-13 14:48:36 +02:00
Serhiy Storchaka 97f46db904 Issue #25410: Made testing that od_fast_nodes and dk_entries are in sync more
reliable.
2015-11-06 12:00:03 +02:00
Serhiy Storchaka d5f353ec8d Issue #24726: Revert setting the value on the dict if
_odict_add_new_node() fails.
2015-11-06 11:07:11 +02:00
Serhiy Storchaka 9c967611e3 Issue #25558: Refactoring OrderedDict iteration. 2015-11-06 10:39:51 +02:00
Serhiy Storchaka 710cd34bdb Issue #25449: Fixed a crash and leaking NULL in repr() of OrderedDict that
was mutated by direct calls of dict methods.
2015-11-04 22:33:07 +02:00
Serhiy Storchaka b45b7b2137 Issue #25449: Iterating OrderedDict with keys with unstable hash now raises
KeyError in C implementations as well as in Python implementation.

Added tests for OrderedDict subclasses.
2015-11-04 22:05:38 +02:00
Serhiy Storchaka 14eefe353e Issue #25395: Fixed crash when highly nested OrderedDict structures were
garbage collected.
2015-11-01 16:12:34 +02:00
Serhiy Storchaka 4575beba4b Issue #25410: C implementation of OrderedDict now uses type(self) instead of
self.__class__ in __repr__() and __reduce__() for simplicity and reliability.
2015-10-22 20:18:24 +03:00
Serhiy Storchaka d17427b7bd Issue #25410: Fixed a memory leak in OrderedDict in the case when key's hash
calculation fails.
2015-10-20 18:21:48 +03:00
Serhiy Storchaka 8003bafd7f Issue #25410: Cleaned up and fixed minor bugs in C implementation of OrderedDict. 2015-10-18 09:53:17 +03:00
Serhiy Storchaka 992ec46acc Issue #25406: Fixed a bug in C implementation of OrderedDict.move_to_end()
that caused segmentation fault or hang in iterating after moving several
items to the start of ordered dict.
2015-10-14 19:21:24 +03:00
Victor Stinner 4a0d1e7c36 odictobject.c: fix compiler warning
PyObject_Length() returns a P_ssize_t, not an int. Use a Py_ssize_t to avoid
overflow.
2015-09-18 13:44:11 +02:00
Victor Stinner ca30b02abe Issue #24992: Fix error handling and a race condition (related to garbage
collection) in collections.OrderedDict constructor.

Patch reviewed by Serhiy Storchaka.
2015-09-03 17:50:04 +02:00
Eric Snow 8c7f9558eb Issue #24667: Resize odict in all cases that the underlying dict resizes. 2015-08-07 17:45:12 -06:00
Benjamin Peterson 0718de9770 repair my irrational excuberance 2015-06-07 00:00:42 -05:00
Benjamin Peterson 99e96f2bb0 remove unnecessary braces and indentation 2015-06-06 23:20:32 -05:00
Benjamin Peterson 2ad80f53c1 fix refleak when keys() fails 2015-06-04 14:34:20 -05:00
Eric Snow 4fabf02633 Issue #24369: Defend against key-changes during iteration. 2015-06-04 00:09:56 -06:00
Eric Snow db4061cb9d Issue #24377: Fix a ref leak in OrderedDict.__repr__. 2015-06-03 11:09:48 -06:00
Eric Snow 4c72918a59 Issue #24362: Simplify the C OrderedDict fast nodes resize logic. 2015-06-03 10:50:37 -06:00
Eric Snow ac02ef373f Issue #24368: Support keyword arguments in OrderedDict methods. 2015-06-02 20:42:14 -06:00
Eric Snow b952ab43f2 Issue #24359: Check for changed OrderedDict size during iteration. 2015-06-01 23:35:13 -06:00
Eric Snow d171975609 Issue #24348: Drop superfluous increfs/decrefs. 2015-06-01 23:12:13 -06:00
Eric Snow a762af74b2 Issue #24347: Set KeyError if PyDict_GetItemWithError returns NULL. 2015-06-01 22:59:08 -06:00
Eric Snow e3dfa9e5ce Issue #16991: Fix a few leaks and other memory-related concerns in OrderedDict. 2015-05-30 12:51:15 -06:00
Eric Snow 67fb92e8c6 Issue #16991: Do not return None from OrderedDict.__reversed__. 2015-05-30 11:43:36 -06:00
Eric Snow c5e59609ac Issue #16991: Properly handle return values in several places. 2015-05-30 11:28:56 -06:00
Eric Snow 96c6af9b20 Issue #16991: Add a C implementation of collections.OrderedDict. 2015-05-29 22:21:39 -06:00