| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
time (GH-30050) (GH-30254) (GH-30255)
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]).
(cherry picked from commit 078abb676cf759b1e960f78390b6e80f256f0255)
(cherry picked from commit 03c7449fbc7c57f5e0365f234a0b65c1dde763f2)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-29394)
This PR fixes a bug in the 3.9 branch where
``functools.singledispatchmethod`` did not properly wrap attributes such as
``__name__``, ``__doc__`` and ``__module__`` of the target method. It also
backports tests already merged into the 3.11 and 3.10 branches in #29328 and
#29390.
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-29087)
This commit fixes a bug in the 3.9 branch where stacking
`@functools.singledispatchmethod` on top of `@classmethod` or `@staticmethod`
caused an exception to be raised if the method was registered using
type-annotations rather than `@method.register(int)`. Tests for this scenario
were added to the 3.11 and 3.10 branches in #29034 and #29072; this commit
also backports those tests to the 3.9 branch.
Co-authored-by: Yurii Karabas <1998uriyyo@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
|
|
|
|
| |
(GH-27641)
|
|
|
|
|
| |
(cherry picked from commit be42c06bb01206209430f3ac08b72643dc7cad1c)
Co-authored-by: Noah Kantrowitz <noah@coderanger.net>
|
|
|
|
|
|
|
|
|
| |
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.
(cherry picked from commit 2f172d8f1525defe9bba4d49e967fdfc69151731)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
|
| |
|
|
|
|
| |
(#19427)
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
deprecation warning (GH-13195)
|
|
|
| |
Automerge-Triggered-By: @pablogsal
|
|
|
|
|
| |
library (GH-11583)
Co-Authored-By: Tim Peters <tim.peters@gmail.com>
|
| |
|
| |
|
| |
|
|
|
| |
Turn deprecation warnings added in 3.8 into TypeError.
|
| |
|
|
|
|
| |
call (GH-13048)
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Deprecated passing the following arguments as keyword arguments:
- "func" in functools.partialmethod(), weakref.finalize(),
profile.Profile.runcall(), cProfile.Profile.runcall(),
bdb.Bdb.runcall(), trace.Trace.runfunc() and
curses.wrapper().
- "function" in unittest.addModuleCleanup() and
unittest.TestCase.addCleanup().
- "fn" in the submit() method of concurrent.futures.ThreadPoolExecutor
and concurrent.futures.ProcessPoolExecutor.
- "callback" in contextlib.ExitStack.callback(),
contextlib.AsyncExitStack.callback() and
contextlib.AsyncExitStack.push_async_callback().
- "c" and "typeid" in the create() method of multiprocessing.managers.Server
and multiprocessing.managers.SharedMemoryServer.
- "obj" in weakref.finalize().
Also allowed to pass arbitrary keyword arguments (even "self" and "func")
if the above arguments are passed as positional argument.
|
| |
|
|
|
|
| |
(GH-11715)
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
isasyncgenfunction work with functools.partial (GH-9903)
inspect.isfunction() processes both inspect.isfunction(func) and
inspect.isfunction(partial(func, arg)) correctly but some other functions in the
inspect module (iscoroutinefunction, isgeneratorfunction and isasyncgenfunction)
lack this functionality. This commits adds a new check in the mentioned functions
in the inspect module so they can work correctly with arbitrarily nested partial
functions.
|
| |
|
|
|
|
|
|
| |
Robust caching of calculated properties is
harder than it looks at first glance, so add
a solid, well-tested implementation to the
standard library.
|
| |
|
| |
|
|
|
|
| |
annotations (#4733)
|
| |
|
|
|
|
|
|
| |
* Remove Setup.config
* Always define WITH_THREAD for compatibility.
|
|
|
|
| |
faster (#3338)
|
|
|
| |
In Python 3.6, sorted() was removed from _make_key() for the lru_cache and instead rely on guaranteed keyword argument order preservation. This makes keyword argument handling faster but it also causes multiple callers with a different keyword argument order to be cached as separate items. Depending on your point of view, this is either a performance regression (increased number of cache misses) or a performance enhancement (faster computation of keys).
|
|\ |
|
| | |
|
|/ |
|
|\ |
|
| | |
|
|/
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
Patch by Ethan Furman.
|
| |
|
| |
|
|
|
|
| |
patches by Matt Joiner and Alexey Kachayev.
|
|
|
|
| |
with specified exception type. Original patch by Ramchandra Apte.
|
|
|
|
| |
(Sugguested by Serhiy Storchaka)
|
| |
|
|
|
|
| |
implementation in issue #21408 they are redundant.
|
|
|
|
| |
mapping to module level.
|