Serhiy Storchaka
a37f356de1
[3.7] bpo-36492: Fix passing special keyword arguments to some functions. (GH-12637) (GH-12645)
...
The following arguments can be passed as keyword arguments for passing
to other function if the corresponding required argument is passed as
positional:
- "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 multiprocessing.managers.Server.create().
- "obj" in weakref.finalize().
(cherry picked from commit 42a139ed88
)
2019-04-01 10:59:24 +03:00
Miss Islington (bot)
533a9b459b
Consistently move the misses update to just before the user function call (GH-11715) (GH-11716)
2019-01-31 15:35:00 -08:00
Miss Islington (bot)
b2b023c657
bpo-35780: Fix errors in lru_cache() C code (GH-11623) (GH-11682)
2019-01-26 03:23:40 -05:00
Miss Islington (bot)
df9f633f94
bpo-33967: Fix singledispatch raised IndexError when no args (GH-8184)
...
(cherry picked from commit 445f1b35ce
)
Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
2018-07-10 00:48:57 -07:00
Łukasz Langa
e56975351b
bpo-32227: functools.singledispatch supports registering via type annotations ( #4733 )
2017-12-11 13:56:31 -08:00
INADA Naoki
9811e80fd0
bpo-31581: Reduce the number of imports for functools (GH-3757)
2017-09-30 16:13:02 +09:00
Antoine Pitrou
a6a4dc816d
bpo-31370: Remove support for threads-less builds ( #3385 )
...
* Remove Setup.config
* Always define WITH_THREAD for compatibility.
2017-09-07 18:56:24 +02:00
Raymond Hettinger
15ce0bee97
Conceptually, roots is a set. Also searching it as a set is a tiny bit faster ( #3338 )
2017-09-05 09:40:44 -07:00
Raymond Hettinger
550370957c
Add comment to explain the implications of not sorting keywords ( #3331 )
...
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).
2017-09-04 17:47:53 -07:00
Raymond Hettinger
ac7c5acf9b
merge
2017-01-08 17:29:21 -08:00
Raymond Hettinger
4ee39141e8
Issue #29203 : functools.lru_cache() now respects PEP 468
2017-01-08 17:28:20 -08:00
Raymond Hettinger
b2d4b3d415
Issue #28991 : Address comment that the __len__ call looked unattractive
2016-12-16 14:59:37 -08:00
Raymond Hettinger
c28dbd0452
merge
2016-12-16 13:59:32 -08:00
Raymond Hettinger
af56e0e70f
Issue #28991 : Fix obscure reentrancy bug in functools.lru_cache().
2016-12-16 13:57:40 -08:00
Nick Coghlan
457fc9a69e
Issue #27137 : align Python & C implementations of functools.partial
...
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.
2016-09-10 20:00:02 +10:00
Serhiy Storchaka
ce2295def3
Removed redundant call of update_wrapper().
2015-10-24 09:51:53 +03:00
Yury Selivanov
77a8cd65be
Issue #23572 : Fixed functools.singledispatch on classes with falsy metaclasses.
...
Patch by Ethan Furman.
2015-08-18 14:20:00 -04:00
Serhiy Storchaka
46c5611948
Backed out changeset: b0a0b9b59012
2015-05-24 21:53:49 +03:00
Larry Hastings
8252cc9832
Backed out changeset 57776eee74f2
2015-05-23 14:56:23 -07:00
Serhiy Storchaka
1c858c352b
Issue #14373 : Added C implementation of functools.lru_cache(). Based on
...
patches by Matt Joiner and Alexey Kachayev.
2015-05-23 22:42:49 +03:00
Serhiy Storchaka
ba9ac5b5c4
Issue #16261 : Converted some bare except statements to except statements
...
with specified exception type. Original patch by Ramchandra Apte.
2015-05-20 10:33:40 +03:00
Raymond Hettinger
ffcd8490d0
Reduce the overhead in functools.total_ordering by localizing NotImplemented.
...
(Sugguested by Serhiy Storchaka)
2015-05-12 21:26:37 -07:00
Alexander Belopolsky
e49af34151
Issue #7830 : Flatten nested functools.partial.
2015-03-01 15:08:17 -05:00
Serhiy Storchaka
08448a1f4d
Issue #23326 : Removed __ne__ implementations. Since fixing default __ne__
...
implementation in issue #21408 they are redundant.
2015-01-31 12:05:05 +02:00
Raymond Hettinger
1a8ada89f9
No need to rebuild a constant dictionary on every call. Move convert mapping to module level.
2015-01-13 22:57:35 -08:00
Raymond Hettinger
e5db863c22
Minor speed-up. Use local variable instead of a global lookup.
2015-01-06 22:16:10 -08:00
Raymond Hettinger
57a3786a62
merge
2015-01-05 22:00:08 -08:00
Raymond Hettinger
0603d3049e
Issue #23132 : Mitigate regression in speed and clarity in functools.total_ordering.
2015-01-05 21:52:10 -08:00
Serhiy Storchaka
697a526fa1
Issue #23132 : Improve performance and introspection support of comparison
...
methods created by functool.total_ordering.
2015-01-01 15:23:12 +02:00
Raymond Hettinger
92c7b90148
merge
2014-08-12 12:45:28 -07:00
Raymond Hettinger
4d58897fdb
Issue 22184: Early detection and reporting of missing lru_cache parameters
2014-08-12 12:44:52 -07:00
Serhiy Storchaka
521e5860a5
Issue #22032 : __qualname__ instead of __name__ is now always used to format
...
fully qualified class names of Python implemented classes.
2014-07-22 15:00:37 +03:00
Victor Stinner
7fa767e517
Issue #20976 : pyflakes: Remove unused imports
2014-03-20 09:16:38 +01:00
Yury Selivanov
da5fe4f2da
inspect.signature: Add support for 'functools.partialmethod' #20223
2014-01-27 17:28:37 -05:00
Nick Coghlan
3daaf5f89d
Fix functools.partialmethod docs and __all__
2013-11-04 23:32:16 +10:00
Nick Coghlan
f4cb48a72b
Issue #4331 : Added functools.partialmethod
...
Initial patch by Alon Horev
2013-11-03 16:41:46 +10:00
Nick Coghlan
f05d981f58
Close #10042 : functools.total_ordering now handles NotImplemented
...
(Patch by Katie Miller)
2013-10-02 00:02:03 +10:00
Nick Coghlan
24c05bc154
Close issue 17482: don't overwrite __wrapped__
2013-07-15 21:13:08 +10:00
Brett Cannon
cd171c8e92
Issue #18200 : Back out usage of ModuleNotFoundError (8d28d44f3a9a)
2013-07-04 17:43:24 -04:00
Łukasz Langa
3720c77e30
Issue #18244 : Adopt C3-based linearization in functools.singledispatch for improved ABC support
2013-07-01 16:00:38 +02:00
Brett Cannon
0a140668fa
Issue #18200 : Update the stdlib (except tests) to use
...
ModuleNotFoundError.
2013-06-13 20:57:26 -04:00
Łukasz Langa
6f69251980
Add reference implementation for PEP 443
...
PEP accepted: http://mail.python.org/pipermail/python-dev/2013-June/126734.html
2013-06-05 12:20:24 +02:00
Raymond Hettinger
36fe22806c
merge
2013-03-08 23:04:47 -08:00
Raymond Hettinger
d8d6010df3
Sync-up with 3.4 to make maintenance easier.
2013-03-08 23:01:07 -08:00
Raymond Hettinger
a28c55a2e4
merge
2013-03-08 21:14:46 -07:00
Raymond Hettinger
f96b2b03bb
Improve comments and variable names.
2013-03-08 21:11:55 -07:00
Raymond Hettinger
bb5f48008d
Merge
2013-03-04 04:20:46 -05:00
Raymond Hettinger
352cc8cfc3
Another nit.
2013-03-04 04:19:09 -05:00
Raymond Hettinger
32e2ff5dc5
merge
2013-03-04 03:54:45 -05:00
Raymond Hettinger
f2c17a9276
Fix other re-entrancy nits for the lru_cache.
...
Keep references for oldkey and oldvalue so they can't
trigger a __del__ method to reenter our thread.
Move the cache[key]=link step to the end, after the link
data is in a consistent state.
Under exotic circumstances, the cache[key]=link step could
trigger reentrancy (i.e. the key would have to have a hash
exactly equal to that for another key in the cache and the
key would need a __eq__ method that makes a reentrant call
our cached function).
2013-03-04 03:34:09 -05:00