aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/functools.py
Commit message (Collapse)AuthorAge
* gh-125028: Prohibit placeholders in partial keywords (GH-126062)dgpb2025-05-08
|
* gh-131525: Remove `_HashedSeq` wrapper from `lru_cache` (gh-131922)Lukas Geiger2025-03-31
|
* gh-127750: Improve repr of functools.singledispatchmethod (GH-130220)Serhiy Storchaka2025-03-05
|
* gh-105499: Merge typing.Union and types.UnionType (#105511)Jelle Zijlstra2025-03-04
| | | | | Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> Co-authored-by: Ken Jin <kenjin@python.org> Co-authored-by: Carl Meyer <carl@oddbird.net>
* gh-127750: Restore inspect and pydoc support of singledispatchmethod (GH-130309)Serhiy Storchaka2025-02-20
| | | | | The code is still flawed, because it does not recognize class and static methods, and the first argument is not removed from the signature of bound methods, but at least it does not worse than in 3.13 and older.
* gh-127750: Fix and optimize functools.singledispatchmethod() (GH-130008)Serhiy Storchaka2025-02-17
| | | | | | | | Remove broken singledispatchmethod caching introduced in gh-85160. Achieve the same performance using different optimization. * Add more tests. * Fix issues with __module__ and __doc__ descriptors.
* gh-121676: Raise a ``DeprecationWarning`` if the Python implementation of ↵Kirill Podoprigora2025-01-01
| | | | | | | | | | | | | | | | | | ``functools.reduce`` is called with `function` or `sequence` as a keyword args (#121677) Python implementation of `functools` allows calling `reduce` with `function` or `sequence` as keyword args. This doesn't match behavior of our C accelerator and our documentation for `functools.reduce` states that `function`and `sequence` are positional-only arguments. Now calling a Python implementation of `functools.reduce` with `function` or `sequence` as keyword args would raise a `DeprecationWarning` and is planned to be prohibited in Python 3.16. Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
* gh-127537: Add __class_getitem__ to the python implementation of ↵CF Bolz-Tereick2024-12-26
| | | | functools.partial (#127537)
* gh-126133: Only use start year in PSF copyright, remove end years (#126236)Hugo van Kemenade2024-11-12
|
* gh-125916: Allow functools.reduce() 'initial' to be a keyword argument (#125917)Sayandip Dutta2024-11-12
|
* Align functools.reduce() docstring with PEP-257 (#126045)Sergey B Kirpichev2024-10-29
| | | Yak-shave in preparation for Argument Clinic adaption in gh-125999.
* functools: Give up on lazy-importing types (#124736)Jelle Zijlstra2024-09-29
| | | | | | | | | PR #121089 added an eager import for types.MethodType, but still left the existing hacks for lazily importing from types. We could also create MethodType internally in functools.py (e.g., by using `type(Placeholder.__repr__)`, but it feels not worth it at this point, so instead I unlazified all the usages of types in the module.
* gh-119127: functools.partial placeholders (gh-119827)dgpb2024-09-26
|
* gh-119180: Add `annotationlib` module to support PEP 649 (#119891)Jelle Zijlstra2024-07-23
| | | Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* gh-121027: Make the functools.partial object a method descriptor (GH-121089)Serhiy Storchaka2024-07-03
| | | Co-authored-by: d.grigonis <dgrigonis@users.noreply.github.com>
* gh-121027: Add a future warning in functools.partial.__get__ (#121086)Serhiy Storchaka2024-06-27
|
* gh-121025: Improve partialmethod.__repr__ (GH-121033)Bénédikt Tran2024-06-26
| | | It no longer contains redundant commas and spaces.
* GH-100242: bring functools.py partial implementation more in line with C ↵CF Bolz-Tereick2024-04-17
| | | | | | | code (GH-100244) in partial.__new__, before checking for the existence of the attribute 'func', first check whether the argument is an instance of partial.
* Add 'The Python 2.3 Method Resolution Order' (#116435)Hugo van Kemenade2024-04-15
|
* gh-72249: Include the module name in the repr of partial object (GH-101910)Furkan Onder2024-02-25
| | | Co-authored-by: Anilyka Barry <vgr255@live.ca>
* gh-85294: Handle missing arguments to @singledispatchmethod gracefully ↵Ammar Askar2024-02-16
| | | | | | (GH-21471) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-38364: unwrap partialmethods just like we unwrap partials (#16600)Martijn Pieters2024-02-15
| | | | | | | | | | | | | * bpo-38364: unwrap partialmethods just like we unwrap partials The inspect.isgeneratorfunction, inspect.iscoroutinefunction and inspect.isasyncgenfunction already unwrap functools.partial objects, this patch adds support for partialmethod objects as well. Also: Rename _partialmethod to __partialmethod__. Since we're checking this attribute on arbitrary function-like objects, we should use the namespace reserved for core Python. --------- Co-authored-by: Petr Viktorin <encukou@gmail.com>
* gh-109653: Avoid a top-level import of `types` in `functools` (#109804)Alex Waygood2023-09-24
|
* gh-102757: fix function signature mismatch for `functools.reduce` between ↵Xuehai Pan2023-09-18
| | | | code and documentation (#102759)
* gh-107995: Fix doctest collection of functools.cached_property objects (#107996)Tyler Smart2023-08-18
| | | Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* gh-85160: Reduce memory usage of `singledispatchmethod` (#107706)Alex Waygood2023-08-07
| | | | | A small followup to #107148 Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* gh-85160: improve performance of `functools.singledispatchmethod` (#107148)Pieter Eendebak2023-08-06
| | | | Co-authored-by: mental <m3nta1@yahoo.com> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* gh-106292: restore checking __dict__ in cached_property.__get__ (#106380)Carl Meyer2023-07-05
| | | | | * gh-106292: restore checking __dict__ in cached_property.__get__ Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
* gh-105172: Fixed functools.lru_cache typed argument docstring. (GH-105173)Bar Harel2023-05-31
|
* gh-104600: Make function.__type_params__ writable (#104601)Jelle Zijlstra2023-05-18
|
* gh-87634: remove locking from functools.cached_property (GH-101890)Carl Meyer2023-02-22
| | | Remove the undocumented locking capabilities of functools.cached_property.
* gh-89828: Do not relay the __class__ attribute in GenericAlias (#93754)Serhiy Storchaka2022-06-18
| | | | | list[int].__class__ returned type, and isinstance(list[int], type) returned True. It caused numerous problems in code that checks isinstance(x, type).
* This localization technique is no longer cost effective. (GH-30818)Raymond Hettinger2022-01-22
|
* bpo-46032: Check types in singledispatch's register() at declaration time ↵Serhiy Storchaka2021-12-25
| | | | | | | | | (GH-30050) The registry() method of functools.singledispatch() functions checks now the first argument or the first parameter annotation and raises a TypeError if it is not supported. Previously unsupported "types" were ignored (e.g. typing.List[int]) or caused an error at calling time (e.g. list[int]).
* bpo-46014: Add ability to use typing.Union with singledispatch (GH-30017)Yurii Karabas2021-12-11
|
* bpo-44605: Teach @total_ordering() to work with metaclasses (GH-27633)Raymond Hettinger2021-08-06
|
* Update URLs in comments and metadata to use HTTPS (GH-27458)Noah Kantrowitz2021-07-30
|
* bpo-31082: Use "iterable" in the docstring for functools.reduce() (GH-20796)Zackery Spytz2020-06-28
|
* bpo-17005: Move topological sort functionality to its own module (GH-20558)Pablo Galindo2020-06-01
| | | | | | The topological sort functionality that was introduced initially in the functools module has been moved to a new graphlib module to better accommodate the new tools and keep the original scope of the functools module.
* bpo-40571: Make lru_cache(maxsize=None) more discoverable (GH-20019)Raymond Hettinger2020-05-11
|
* bpo-39481: Make functools.cached_property, partial, partialmethod generic ↵Ethan Smith2020-04-13
| | | | (#19427)
* Updates functools.py with consistent quotes (GH-18825)Nikita Sobolev2020-03-10
| | | | | | I have noticed that `'` quotes are used everywhere except this particular case, which was introduced in https://github.com/python/cpython/pull/18726 So, this is a trivial fix to enforce better consistency.
* bpo-35712: Make using NotImplemented in a boolean context issue a ↵MojoVampire2020-03-03
| | | | deprecation warning (GH-13195)
* bpo-39815: add cached_property to all (GH-18726)Hakan Çelik2020-03-01
| | | Automerge-Triggered-By: @pablogsal
* bpo-17005: Add a class to perform topological sorting to the standard ↵Pablo Galindo2020-01-23
| | | | | library (GH-11583) Co-Authored-By: Tim Peters <tim.peters@gmail.com>
* bpo-38565: add new cache_parameters method for lru_cache (GH-16916)Manjusaka2019-11-11
|
* Doc: Fix Wikipedia link for functools.lru_cache (GH-16183)amist2019-09-16
|
* bpo-36743: __get__ is sometimes called without the owner argument (#12992)Raymond Hettinger2019-08-29
|
* [3.9] bpo-37116: Use PEP 570 syntax for positional-only parameters. (GH-12620)Serhiy Storchaka2019-06-05
| | | Turn deprecation warnings added in 3.8 into TypeError.
* bpo-37116: Use PEP 570 syntax for positional-only parameters. (GH-13700)Serhiy Storchaka2019-06-01
|