summaryrefslogtreecommitdiff
path: root/Modules/_functoolsmodule.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix uninitialized struct member (GH-19589)Raymond Hettinger2020-04-201-0/+1
|
* bpo-40268: Remove unused pycore_pymem.h includes (GH-19531)Victor Stinner2020-04-151-1/+0
|
* bpo-40268: Remove unused structmember.h includes (GH-19530)Victor Stinner2020-04-151-2/+2
| | | | | | If only offsetof() is needed: include stddef.h instead. When structmember.h is used, add a comment explaining that PyMemberDef is used.
* bpo-40268: Remove a few pycore_pystate.h includes (GH-19510)Victor Stinner2020-04-141-1/+1
|
* bpo-39481: Make functools.cached_property, partial, partialmethod generic ↵Ethan Smith2020-04-131-0/+2
| | | | (#19427)
* bpo-40071: Fix potential crash in _functoolsmodule.c (GH-19273)Paulo Henrique Silva2020-04-011-1/+4
| | | | | | | | | | | | | | | | | Changes on 7dd549eb0893 made _functools compatible with PEP-489 and we could have multiple modules instances loaded. But, right now there is no way to make `kwd_mark` global into a per module instance variable. kwd_mark is used on lru_cache_new which does not have a reference to a PyModule*, necessary to use PyModule_GetState. PEP-573 will solve this problem and will allow us to move the global state to per-module data and properly clear the state when unloading a module instance. This change temporarily disable cleaning of kwd_mark to avoid NULL pointer dereference if we clear kwd_mark and other module instances still alive use it.
* bpo-40071: Fix refleak in _functools module (GH19172)Paulo Henrique Silva2020-03-261-2/+4
|
* bpo-1635741: Port _functools module to multiphase initialization (PEP 489) ↵Paulo Henrique Silva2020-03-251-28/+32
| | | | (GH-19151)
* bpo-40024: Add PyModule_AddType() helper function (GH-19088)Dong-hee Na2020-03-221-9/+3
|
* bpo-39573: Use Py_IS_TYPE() macro to check for types (GH-18809)Andy Lester2020-03-061-1/+1
| | | Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-39573: Clean up modules and headers to use Py_IS_TYPE() function (GH-18521)Dong-hee Na2020-02-171-1/+1
|
* bpo-39245: Switch to public API for Vectorcall (GH-18460)Petr Viktorin2020-02-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The bulk of this patch was generated automatically with: for name in \ PyObject_Vectorcall \ Py_TPFLAGS_HAVE_VECTORCALL \ PyObject_VectorcallMethod \ PyVectorcall_Function \ PyObject_CallOneArg \ PyObject_CallMethodNoArgs \ PyObject_CallMethodOneArg \ ; do echo $name git grep -lwz _$name | xargs -0 sed -i "s/\b_$name\b/$name/g" done old=_PyObject_FastCallDict new=PyObject_VectorcallDict git grep -lwz $old | xargs -0 sed -i "s/\b$old\b/$new/g" and then cleaned up: - Revert changes to in docs & news - Revert changes to backcompat defines in headers - Nudge misaligned comments
* bpo-39573: Use Py_REFCNT() macro (GH-18388)Victor Stinner2020-02-071-2/+2
| | | | Replace direct acccess to PyObject.ob_refcnt with usage of the Py_REFCNT() macro.
* bpo-38644: Add _PyObject_VectorcallTstate() (GH-17052)Victor Stinner2019-11-081-7/+14
| | | | | * Add _PyObject_VectorcallTstate() function: similar to _PyObject_Vectorcall(), but with tstate parameter * Add tstate parameter to _PyObject_MakeTpCall()
* bpo-37358: Use vectorcall for functools.partial (GH-14284)Jeroen Demeyer2019-07-131-66/+98
| | | https://bugs.python.org/issue37358
* bpo-34303: Micro-optimizations in functools.reduce() (GH-8598)Sergey Fedoseev2019-06-011-3/+6
|
* bpo-36974: tp_print -> tp_vectorcall_offset and tp_reserved -> tp_as_async ↵Jeroen Demeyer2019-05-301-8/+8
| | | | | | | | | (GH-13464) Automatically replace tp_print -> tp_vectorcall_offset tp_compare -> tp_as_async tp_reserved -> tp_as_async
* bpo-36974: remove _PyObject_HasFastCall (GH-13460)Jeroen Demeyer2019-05-301-2/+2
|
* bpo-36922: implement PEP-590 Py_TPFLAGS_METHOD_DESCRIPTOR (GH-13338)Jeroen Demeyer2019-05-281-1/+2
| | | Co-authored-by: Mark Shannon <mark@hotpy.org>
* bpo-36650: Fix handling of empty keyword args in C version of lru_cache. ↵Raymond Hettinger2019-04-201-4/+3
| | | | (GH-12881)
* lru_cache: Add more comments. Fix comment typos. Clarify a comment. (GH-11795)Raymond Hettinger2019-02-081-4/+25
|
* Consistently move the misses update to just before the user function call ↵Raymond Hettinger2019-01-311-3/+5
| | | | (GH-11715)
* bpo-35780: Fix errors in lru_cache() C code (GH-11623)Raymond Hettinger2019-01-261-84/+188
|
* bpo-33012: Fix invalid function cast warnings with gcc 8. (GH-6749)Serhiy Storchaka2018-11-271-1/+1
| | | | | | 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-35081: Add Include/internal/pycore_tupleobject.h (GH-10705)Victor Stinner2018-11-251-1/+1
| | | | Move _PyTuple_ITEMS() to a new header file: Include/internal/pycore_tupleobject.h
* 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-11-011-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-261-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-071-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-081-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-081-0/+6
| | |
* | | Complete the merge for issue #29203Raymond Hettinger2017-01-081-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.