]> granicus.if.org Git - python/commit
bpo-36492: Deprecate passing some arguments as keyword arguments. (GH-12637)
authorSerhiy Storchaka <storchaka@gmail.com>
Mon, 1 Apr 2019 06:16:35 +0000 (09:16 +0300)
committerGitHub <noreply@github.com>
Mon, 1 Apr 2019 06:16:35 +0000 (09:16 +0300)
commit42a139ed88c487f325a241c6ee8b308b3c045975
treede56527188eff240b06496c3451e525af959dcad
parent5f2c50810a67982b0c80f6d3258fee3647f67005
bpo-36492: Deprecate passing some arguments as keyword arguments. (GH-12637)

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.
22 files changed:
Doc/whatsnew/3.8.rst
Lib/bdb.py
Lib/cProfile.py
Lib/concurrent/futures/_base.py
Lib/concurrent/futures/process.py
Lib/concurrent/futures/thread.py
Lib/contextlib.py
Lib/curses/__init__.py
Lib/functools.py
Lib/multiprocessing/managers.py
Lib/profile.py
Lib/test/test_concurrent_futures.py
Lib/test/test_contextlib.py
Lib/test/test_contextlib_async.py
Lib/test/test_functools.py
Lib/test/test_trace.py
Lib/test/test_weakref.py
Lib/trace.py
Lib/unittest/case.py
Lib/unittest/test/test_runner.py
Lib/weakref.py
Misc/NEWS.d/next/Library/2019-03-31-10-21-54.bpo-36492.f7vyUs.rst [new file with mode: 0644]