summaryrefslogtreecommitdiffstats
path: root/Modules/_functoolsmodule.c
Commit message (Collapse)AuthorAgeFilesLines
* bpo-35081: Rename internal headers (GH-10275)Victor Stinner2018-11-121-2/+2
| | | | | | | | | | | | | | 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-35199: Add an internal _PyTuple_ITEMS() macro (GH-10434)Victor Stinner2018-11-091-3/+3
| | | | | | | * _PyTuple_ITEMS() gives access to the tuple->ob_item field and cast the first argument to PyTupleObject*. This internal macro is only usable if Py_BUILD_CORE is defined. * Replace &PyTuple_GET_ITEM(ob, 0) with _PyTuple_ITEMS(ob). * Replace PyTuple_GET_ITEM(op, 1) with &_PyTuple_ITEMS(ob)[1].
* bpo-35081: Add pycore_ prefix to internal header files (GH-10263)Victor Stinner2018-10-311-2/+2
| | | | | | | | | | | | | | | | | | | | * 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-32422: Reduce lru_cache memory usage (GH-5008)INADA Naoki2017-12-251-26/+6
|
* bpo-31497: Add private helper _PyType_Name(). (#3630)Serhiy Storchaka2017-09-171-4/+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/+2
| | | | | | | * 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-31095: fix potential crash during GC (GH-2974)INADA Naoki2017-08-241-1/+6
|
* bpo-29878: Add global instances of int for 0 and 1. (#852)Serhiy Storchaka2017-03-301-8/+1
|
* Simplify partial.__new__. (#813)Serhiy Storchaka2017-03-251-8/+2
| | | | Fast paths in partial.__new__ no longer needed since concatenating with empty tuple was optimized.
* bpo-29800: Fix crashes in partial.__repr__ if the keys of partial.keywords ↵Michael Seifert2017-03-151-1/+4
| | | | are not strings (#649)
* bpo-29735: Optimize partial_call(): avoid tuple (#516)Victor Stinner2017-03-141-35/+80
| | | | | | | | * Add _PyObject_HasFastCall() * partial_call() now avoids temporary tuple to pass positional arguments if the callable supports the FASTCALL calling convention for positional arguments. * Fix also a performance regression in partial_call() if the callable doesn't support FASTCALL.
* Document why functools.partial() must copy kwargs (#253)Victor Stinner2017-02-231-0/+3
| | | | Add a comment to prevent further attempts to avoid a copy for optimization.
* bpo-29532: Altering a kwarg dictionary passed to functools.partial() (#190)Serhiy Storchaka2017-02-201-1/+4
| | | no longer affects a partial object after creation.
* Issue #28969: Fixed race condition in C implementation of functools.lru_cache.Serhiy Storchaka2017-01-121-22/+36
|\ | | | | | | | | KeyError could be raised when cached function with full cache was simultaneously called from differen threads with the same uncached arguments.
| * Issue #28969: Fixed race condition in C implementation of functools.lru_cache.Serhiy Storchaka2017-01-121-22/+36
| |\ | | | | | | | | | | | | KeyError could be raised when cached function with full cache was simultaneously called from differen threads with the same uncached arguments.
| | * Issue #28969: Fixed race condition in C implementation of functools.lru_cache.Serhiy Storchaka2017-01-121-22/+36
| | | | | | | | | | | | | | | KeyError could be raised when cached function with full cache was simultaneously called from differen threads with the same uncached arguments.
| * | Issue #29203: functools.lru_cache() now respects PEP 468Raymond Hettinger2017-01-091-31/+18
| | |
* | | Backed out changeset ea064ff3c10fRaymond Hettinger2017-01-091-6/+0
| | |
* | | Sync-up lru_cache() C code with space saving feature in the Python version.Raymond Hettinger2017-01-091-0/+6
| | |
* | | Complete the merge for issue #29203Raymond Hettinger2017-01-091-31/+18
| | |
* | | Issue #28959: Added private macro PyDict_GET_SIZE for retrieving the size of ↵Serhiy Storchaka2016-12-161-5/+5
| | | | | | | | | | | | dict.
* | | Use _PyObject_CallNoArg()Victor Stinner2016-12-061-1/+1
|/ / | | | | | | | | | | | | Replace: PyObject_CallObject(callable, NULL) with: _PyObject_CallNoArg(callable)
* | Merge 3.6 (issue #28653)Yury Selivanov2016-11-091-2/+6
|\ \ | |/
| * Issue #28653: Fix a refleak in functools.lru_cache.Yury Selivanov2016-11-091-2/+6
| |
* | Issue #27137: align Python & C implementations of functools.partialNick Coghlan2016-09-101-1/+1
| | | | | | | | | | | | | | | | The pure Python fallback implementation of functools.partial now matches the behaviour of its accelerated C counterpart for subclassing, pickling and text representation purposes. Patch by Emanuel Barry and Serhiy Storchaka.
* | Issue #27809: partial_call() uses fast call for positional argsVictor Stinner2016-08-231-12/+28
| |
* | Rename _PyObject_FastCall() to _PyObject_FastCallDict()Victor Stinner2016-08-221-1/+1
| | | | | | | | | | | | | | | | Issue #27809: * Rename _PyObject_FastCall() function to _PyObject_FastCallDict() * Add _PyObject_FastCall(), _PyObject_CallNoArg() and _PyObject_CallArg1() macros calling _PyObject_FastCallDict()
* | keyobject_richcompare() now uses fast callVictor Stinner2016-08-191-11/+7
|/ | | | | Issue #27128: keyobject_richcompare() now calls _PyObject_FastCall() using a small stack allocated on the C stack to avoid a temporary tuple.
* Issue #25455: Fixed a crash in repr of recursive functools.partial objects.Serhiy Storchaka2016-06-121-17/+22
|
* Issue #26200: Restored more safe usages of Py_SETREF.Serhiy Storchaka2016-04-111-3/+3
|
* Issue #22570: Renamed Py_SETREF to Py_XSETREF.Serhiy Storchaka2016-04-061-4/+4
|
* Issue #25945: Fixed bugs in functools.partial.Serhiy Storchaka2016-02-021-60/+68
| | | | | | | Fixed a crash when unpickle the functools.partial object with wrong state. Fixed a leak in failed functools.partial constructor. "args" and "keywords" attributes of functools.partial have now always types tuple and dict correspondingly.
* Issue #25447: Copying the lru_cache() wrapper object now always works,Serhiy Storchaka2015-12-281-0/+16
| | | | | independedly from the type of the wrapped object (by returning the original object unchanged).
* Issue #25447: The lru_cache() wrapper objects now can be copied and pickledSerhiy Storchaka2015-10-241-0/+7
| | | | (by returning the original object unchanged).
* Issue #24483: C implementation of functools.lru_cache() now calculates key'sSerhiy Storchaka2015-10-021-6/+20
| | | | hash only once.
* Issue #14373: Fixed segmentation fault when gc.collect() is called duringSerhiy Storchaka2015-07-251-5/+6
| | | | constructing lru_cache (C implementation).
* Issue #14373: C implementation of functools.lru_cache() now can be used withSerhiy Storchaka2015-06-081-1/+11
| | | | methods.
* Backed out changeset: b0a0b9b59012Serhiy Storchaka2015-05-241-1/+546
|
* Backed out changeset 57776eee74f2Larry Hastings2015-05-231-546/+1
|
* Issue #14373: Added C implementation of functools.lru_cache(). Based onSerhiy Storchaka2015-05-231-1/+546
| | | | patches by Matt Joiner and Alexey Kachayev.
* merge 3.4Benjamin Peterson2015-05-091-2/+11
|\
| * ensure .keywords is always a dictBenjamin Peterson2015-05-091-9/+5
| |
* | Issue #7830: Flatten nested functools.partial.Alexander Belopolsky2015-03-011-7/+48
|/
* Issue #6083: Fix multiple segmentation faults occured when PyArg_ParseTupleSerhiy Storchaka2013-02-041-3/+3
|\ | | | | | | parses nested mutating sequence.
| * Issue #6083: Fix multiple segmentation faults occured when PyArg_ParseTupleSerhiy Storchaka2013-02-041-3/+3
| | | | | | | | parses nested mutating sequence.
* | use new generic __dict__ descriptor implementationsBenjamin Peterson2012-02-201-37/+1
| |
* | Fix nit (make spelling consistent in prototype)Raymond Hettinger2011-04-091-1/+1
| |
* | implement tp_clearBenjamin Peterson2011-04-051-1/+10
| |
* | Issue #11707: Fix compilation errors with Visual StudioVictor Stinner2011-04-051-6/+8
| | | | | | | | Fix also a compiler (gcc) warning.
* | Issue #11707: Fast C version of functools.cmp_to_key()Raymond Hettinger2011-04-051-0/+161
|/