Victor Stinner
b05cbac052
Convert some OrderedDict methods to Argument Clinic
Issue #29289 . Convert methods:
* fromkeys() class method
* setdefault()
* popitem()
* move_to_end()
9 years ago
Martin Panter
536d70ed33
Fix grammar, typos and markup in documentation and code comments
* Indent versionchanged at method level, not class level
* Mark up ``--help`` to avoid generating an en dash
* Use forward slash in Unix command line with a dollar sign ($) prompt
9 years ago
Serhiy Storchaka
5ab81d787f
Issue #28959 : Added private macro PyDict_GET_SIZE for retrieving the size of dict.
9 years ago
INADA Naoki
ba6097734d
Issue #28818 : Simplify lookdict functions
9 years ago
Victor Stinner
f17c3de263
Use _PyObject_CallNoArg()
Replace:
PyObject_CallFunctionObjArgs(callable, NULL)
with:
_PyObject_CallNoArg(callable)
9 years ago
Victor Stinner
de4ae3d486
Backed out changeset b9c9691c72c5
Issue #28858 : The change b9c9691c72c5 introduced a regression. It seems like
_PyObject_CallArg1() uses more stack memory than
PyObject_CallFunctionObjArgs().
9 years ago
Victor Stinner
27580c1fb5
Replace PyObject_CallFunctionObjArgs() with fastcall
* PyObject_CallFunctionObjArgs(func, NULL) => _PyObject_CallNoArg(func)
* PyObject_CallFunctionObjArgs(func, arg, NULL) => _PyObject_CallArg1(func, arg)
PyObject_CallFunctionObjArgs() allocates 40 bytes on the C stack and requires
extra work to "parse" C arguments to build a C array of PyObject*.
_PyObject_CallNoArg() and _PyObject_CallArg1() are simpler and don't allocate
memory on the C stack.
This change is part of the fastcall project. The change on listsort() is
related to the issue #23507 .
9 years ago
Serhiy Storchaka
0438683939
Backed out changeset 9f7505019767 (issue #27275 ).
9 years ago
Serhiy Storchaka
4832580596
Issue #27275 : Fixed implementation of pop() and popitem() methods in
subclasses of accelerated OrderedDict.
9 years ago
Eric Snow
06aed90a1f
Issue #27576 : Fix call order in OrderedDict.__init__().
9 years ago
Eric Snow
4f29e75289
Issue #24254 : Drop cls.__definition_order__.
9 years ago
Benjamin Peterson
ee178e6d6e
fix spelling
9 years ago
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.
9 years ago
Eric Snow
92a6c170e6
Issue #24254 : Preserve class attribute definition order.
9 years ago
Martin Panter
69332c1a64
Fix spelling and grammar in documentation and code comments
10 years ago
Victor Stinner
e18719509f
odict: Remove useless ";" after function definition
Fix a "gcc -pendatic" warning.
10 years ago
Serhiy Storchaka
d2962f145a
Issue #25949 : __dict__ for an OrderedDict instance is now created only when
needed.
10 years ago
Serhiy Storchaka
d205d0145c
Issue #25935 : Garbage collector now breaks reference loops with OrderedDict.
10 years ago
Serhiy Storchaka
0ce7a3a34c
Issue #25914 : Fixed and simplified OrderedDict.__sizeof__.
10 years ago
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.
10 years ago
Serhiy Storchaka
19a70e7f5d
Issue #25462 : The hash of the key now is calculated only once in most
operations in C implementation of OrderedDict.
10 years ago
Serhiy Storchaka
97f46db904
Issue #25410 : Made testing that od_fast_nodes and dk_entries are in sync more
reliable.
10 years ago
Serhiy Storchaka
d5f353ec8d
Issue #24726 : Revert setting the value on the dict if
_odict_add_new_node() fails.
10 years ago
Serhiy Storchaka
9c967611e3
Issue #25558 : Refactoring OrderedDict iteration.
10 years ago
Serhiy Storchaka
710cd34bdb
Issue #25449 : Fixed a crash and leaking NULL in repr() of OrderedDict that
was mutated by direct calls of dict methods.
10 years ago
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.
10 years ago
Serhiy Storchaka
14eefe353e
Issue #25395 : Fixed crash when highly nested OrderedDict structures were
garbage collected.
10 years ago
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.
10 years ago
Serhiy Storchaka
d17427b7bd
Issue #25410 : Fixed a memory leak in OrderedDict in the case when key's hash
calculation fails.
10 years ago
Serhiy Storchaka
8003bafd7f
Issue #25410 : Cleaned up and fixed minor bugs in C implementation of OrderedDict.
10 years ago
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.
10 years ago
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.
10 years ago
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.
10 years ago
Eric Snow
8c7f9558eb
Issue #24667 : Resize odict in all cases that the underlying dict resizes.
11 years ago
Benjamin Peterson
0718de9770
repair my irrational excuberance
11 years ago
Benjamin Peterson
99e96f2bb0
remove unnecessary braces and indentation
11 years ago
Benjamin Peterson
2ad80f53c1
fix refleak when keys() fails
11 years ago
Eric Snow
4fabf02633
Issue #24369 : Defend against key-changes during iteration.
11 years ago
Eric Snow
db4061cb9d
Issue #24377 : Fix a ref leak in OrderedDict.__repr__.
11 years ago
Eric Snow
4c72918a59
Issue #24362 : Simplify the C OrderedDict fast nodes resize logic.
11 years ago
Eric Snow
ac02ef373f
Issue #24368 : Support keyword arguments in OrderedDict methods.
11 years ago
Eric Snow
b952ab43f2
Issue #24359 : Check for changed OrderedDict size during iteration.
11 years ago
Eric Snow
d171975609
Issue #24348 : Drop superfluous increfs/decrefs.
11 years ago
Eric Snow
a762af74b2
Issue #24347 : Set KeyError if PyDict_GetItemWithError returns NULL.
11 years ago
Eric Snow
e3dfa9e5ce
Issue #16991 : Fix a few leaks and other memory-related concerns in OrderedDict.
11 years ago
Eric Snow
67fb92e8c6
Issue #16991 : Do not return None from OrderedDict.__reversed__.
11 years ago
Eric Snow
c5e59609ac
Issue #16991 : Properly handle return values in several places.
11 years ago
Eric Snow
96c6af9b20
Issue #16991 : Add a C implementation of collections.OrderedDict.
11 years ago
Eric Snow
47db71756d
Issue #16991 : Add a C implementation of collections.OrderedDict.
11 years ago