summaryrefslogtreecommitdiffstats
path: root/Objects/odictobject.c
Commit message (Collapse)AuthorAgeFilesLines
* bpo-36254: Fix invalid uses of %d in format strings in C. (GH-12264)Serhiy Storchaka2019-03-131-2/+2
|
* bpo-35444: Unify and optimize the helper for getting a builtin object. ↵Serhiy Storchaka2018-12-111-1/+2
| | | | | | | | (GH-11047) This speeds up pickling of some iterators. This fixes also error handling in pickling methods when fail to look up builtin "getattr".
* bpo-33012: Fix invalid function cast warnings with gcc 8. (GH-6749)Serhiy Storchaka2018-11-271-2/+2
| | | | | | Fix invalid function cast warnings with gcc 8 for method conventions different from METH_NOARGS, METH_O and METH_VARARGS excluding Argument Clinic generated code.
* bpo-33012: Fix signatures of METH_NOARGS funstions. (GH-10736)Serhiy Storchaka2018-11-271-1/+1
|
* bpo-35081: Add Include/internal/pycore_object.h (GH-10640)Victor Stinner2018-11-211-0/+1
| | | | Move _PyObject_GC_TRACK() and _PyObject_GC_UNTRACK() from Include/objimpl.h to Include/internal/pycore_object.h.
* bpo-35081: Rename internal headers (GH-10275)Victor Stinner2018-11-121-1/+1
| | | | | | | | | | | | | | Rename Include/internal/ headers: * pycore_hash.h -> pycore_pyhash.h * pycore_lifecycle.h -> pycore_pylifecycle.h * pycore_mem.h -> pycore_pymem.h * pycore_state.h -> pycore_pystate.h Add missing headers to Makefile.pre.in and PCbuild: * pycore_condvar.h. * pycore_hamt.h * pycore_pyhash.h
* bpo-35081: Add _PyThreadState_GET() internal macro (GH-10266)Victor Stinner2018-11-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | If Py_BUILD_CORE is defined, the PyThreadState_GET() macro access _PyRuntime which comes from the internal pycore_state.h header. Public headers must not require internal headers. Move PyThreadState_GET() and _PyInterpreterState_GET_UNSAFE() from Include/pystate.h to Include/internal/pycore_state.h, and rename PyThreadState_GET() to _PyThreadState_GET() there. The PyThreadState_GET() macro of pystate.h is now redefined when pycore_state.h is included, to use the fast _PyThreadState_GET(). Changes: * Add _PyThreadState_GET() macro * Replace "PyThreadState_GET()->interp" with _PyInterpreterState_GET_UNSAFE() * Replace PyThreadState_GET() with _PyThreadState_GET() in internal C files (compiled with Py_BUILD_CORE defined), but keep PyThreadState_GET() in the public header files. * _testcapimodule.c: replace PyThreadState_GET() with PyThreadState_Get(); the module is not compiled with Py_BUILD_CORE defined. * pycore_state.h now requires Py_BUILD_CORE to be defined.
* bpo-35081: Add pycore_ prefix to internal header files (GH-10263)Victor Stinner2018-10-311-1/+1
| | | | | | | | | | | | | | | | | | | | * Rename Include/internal/ header files: * pyatomic.h -> pycore_atomic.h * ceval.h -> pycore_ceval.h * condvar.h -> pycore_condvar.h * context.h -> pycore_context.h * pygetopt.h -> pycore_getopt.h * gil.h -> pycore_gil.h * hamt.h -> pycore_hamt.h * hash.h -> pycore_hash.h * mem.h -> pycore_mem.h * pystate.h -> pycore_state.h * warnings.h -> pycore_warnings.h * PCbuild project, Makefile.pre.in, Modules/Setup: add the Include/internal/ directory to the search paths of header files. * Update includes. For example, replace #include "internal/mem.h" with #include "pycore_mem.h".
* bpo-34574: Prevent OrderedDict iterators from exhaustion during pickling. ↵Sergey Fedoseev2018-10-201-28/+9
| | | | (GH-9051)
* bpo-33712: OrderedDict only creates od_fast_nodes cache if needed (GH-7349)Serhiy Storchaka2018-10-191-50/+18
|
* fix two typos in Objects/odictobject.c comments (GH-8040)Robert Krzyzanowski2018-07-061-2/+2
|
* bpo-33012: Fix invalid function cast warnings with gcc 8 for METH_NOARGS. ↵Siddhesh Poyarekar2018-04-291-18/+18
| | | | | | | | | (GH-6030) METH_NOARGS functions need only a single argument but they are cast into a PyCFunction, which takes two arguments. This triggers an invalid function cast warning in gcc8 due to the argument mismatch. Fix this by adding a dummy unused argument.
* bpo-33031: Remove dead code in C implementation of OrderedDict. (GH-6120)Serhiy Storchaka2018-04-091-76/+1
| | | | This code doesn't have effect on the final result, but causes GCC 8 warnings and can have an undefined behavior.
* bpo-32747: Remove trailing spaces in docstrings. (GH-5491)oldk2018-02-021-1/+1
|
* bpo-32571: Avoid raising unneeded AttributeError and silencing it in C code ↵Serhiy Storchaka2018-01-251-14/+6
| | | | | (GH-5222) Add two new private APIs: _PyObject_LookupAttr() and _PyObject_LookupAttrId()
* bpo-31572: Get rid of _PyObject_HasAttrId() in dict and OrderedDict. (#3728)Serhiy Storchaka2017-11-111-17/+34
| | | | | Silence only AttributeError when get "key" and "items" attributes in the constructor and the update() method of dict and OrderedDict .
* Add the const qualifier to "char *" variables that refer to literal strings. ↵Serhiy Storchaka2017-11-111-2/+2
| | | | (#4370)
* bpo-31497: Add private helper _PyType_Name(). (#3630)Serhiy Storchaka2017-09-171-9/+3
| | | | This function returns the last component of tp_name after a dot. Returns tp_name itself if it doesn't contain a dot.
* bpo-30860: Consolidate stateful runtime globals. (#3397)Eric Snow2017-09-081-0/+1
| | | | | | | * group the (stateful) runtime globals into various topical structs * consolidate the topical structs under a single top-level _PyRuntimeState struct * add a check-c-globals.py script that helps identify runtime globals Other globals are excluded (see globals.txt and check-c-globals.py).
* bpo-30662: fixed OrderedDict.__init__ docstring re PEP 468 (#2179)Jonathan Eunice2017-09-051-2/+1
| | | | | | | | | | | | * fixed OrderedDict.__init__ docstring re PEP 468 * tightened comment and mirrored to C impl * added space after period per marco-buttu * preserved substituted for stable * drop references to Python 3.6 and PEP 468
* bpo-29304: Simplify dict lookup functions (GH-2407)INADA Naoki2017-08-031-1/+1
| | | | * remove hashpos parameter from lookdict functions. * remove many duplicated code from lookdict functions.
* bpo-29867: Add asserts in PyTuple_GET_SIZE, PyList_GET_SIZE and ↵Serhiy Storchaka2017-04-211-1/+1
| | | | PySet_GET_SIZE. (#751)
* Issues #29311, #29289: Fixed and improved docstrings for dict and OrderedDictSerhiy Storchaka2017-01-241-12/+11
| | | | methods.
* Issue #29289: Argument Clinic generates reasonable name for the parameter ↵Serhiy Storchaka2017-01-191-9/+9
| | | | "default".
* Convert some OrderedDict methods to Argument ClinicVictor Stinner2017-01-171-87/+84
| | | | | | | | | Issue #29289. Convert methods: * fromkeys() class method * setdefault() * popitem() * move_to_end()
* Merge doc fixes from 3.6Martin Panter2017-01-141-1/+1
|\
| * Merge doc fixes from 3.5Martin Panter2017-01-141-1/+1
| |\
| | * Fix grammar, typos and markup in documentation and code commentsMartin Panter2017-01-141-1/+1
| | | | | | | | | | | | | | | | | | * 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
* | | Issue #28959: Added private macro PyDict_GET_SIZE for retrieving the size of ↵Serhiy Storchaka2016-12-161-2/+1
| | | | | | | | | | | | dict.
* | | Issue #28818: Simplify lookdict functionsINADA Naoki2016-12-071-2/+2
| | |
* | | Use _PyObject_CallNoArg()Victor Stinner2016-12-061-1/+1
| | | | | | | | | | | | | | | | | | | | | Replace: PyObject_CallFunctionObjArgs(callable, NULL) with: _PyObject_CallNoArg(callable)
* | | Backed out changeset b9c9691c72c5Victor Stinner2016-12-041-1/+1
| | | | | | | | | | | | | | | | | | Issue #28858: The change b9c9691c72c5 introduced a regression. It seems like _PyObject_CallArg1() uses more stack memory than PyObject_CallFunctionObjArgs().
* | | Replace PyObject_CallFunctionObjArgs() with fastcallVictor Stinner2016-12-011-1/+1
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* | Merge from 3.5.Serhiy Storchaka2016-10-301-7/+22
|\ \ | |/
| * Backed out changeset 9f7505019767 (issue #27275).Serhiy Storchaka2016-10-301-7/+22
| |
* | Issue #27275: Fixed implementation of pop() and popitem() methods inSerhiy Storchaka2016-10-251-22/+7
|\ \ | |/ | | | | subclasses of accelerated OrderedDict.
| * Issue #27275: Fixed implementation of pop() and popitem() methods inSerhiy Storchaka2016-10-251-22/+7
| | | | | | | | subclasses of accelerated OrderedDict.
* | Issue #27576: Fix call order in OrderedDict.__init__().Eric Snow2016-09-091-2/+15
| |
* | Issue #24254: Drop cls.__definition_order__.Eric Snow2016-09-081-15/+0
| |
* | fix spellingBenjamin Peterson2016-09-081-1/+1
| |
* | Implement compact dictVictor Stinner2016-09-081-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Issue #24254: Preserve class attribute definition order.Eric Snow2016-09-051-0/+15
| |
* | Merge spelling and grammar fixes from 3.5Martin Panter2016-08-051-1/+1
|\ \ | |/
| * Fix spelling and grammar in documentation and code commentsMartin Panter2016-08-041-1/+1
| |
* | odict: Remove useless ";" after function definitionVictor Stinner2016-06-081-9/+9
| | | | | | | | Fix a "gcc -pendatic" warning.
* | Issue #25949: __dict__ for an OrderedDict instance is now created only whenSerhiy Storchaka2016-02-081-16/+7
|/ | | | needed.
* Issue #25935: Garbage collector now breaks reference loops with OrderedDict.Serhiy Storchaka2016-01-191-13/+14
|
* Issue #25914: Fixed and simplified OrderedDict.__sizeof__.Serhiy Storchaka2015-12-221-21/+1
|
* Issue #25421: __sizeof__ methods of builtin types now use dynamic basic size.Serhiy Storchaka2015-12-191-2/+0
| | | | | This allows sys.getsize() to work correctly with their subclasses with __slots__ defined.
* Issue #25462: The hash of the key now is calculated only once in mostSerhiy Storchaka2015-11-131-35/+83
| | | | operations in C implementation of OrderedDict.