This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Add partial.kwargs
Type: enhancement Stage: patch review
Components: Library (Lib) Versions: Python 3.6
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: belopolsky, gvanrossum, rhettinger, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2016-02-25 08:16 by serhiy.storchaka, last changed 2022-04-11 14:58 by admin.

Files
File name Uploaded Description Edit
partial_kwargs.patch serhiy.storchaka, 2016-02-25 08:16 review
Messages (2)
msg260843 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2016-02-25 08:16
Most Python classes that exposes a dictionary of keyword arguments as an attribute, name this attribute "kwargs":

concurrent.futures.process._CallItem
concurrent.futures.process._WorkItem
concurrent.futures.thread._WorkItem
inspect.BoundArguments
sched.Event
threading.Timer
unittest.mock._patch
weakref.finalize._Info

The only exceptions are classes contextlib._GeneratorContextManager with the "kwds" attribute and functools.partial and functools.partialmethod with the "keywords" attribute.

Proposed patch adds the "kwargs" alias to the the "keywords" attribute in functools.partial and functools.partialmethod.

There are precedences for adding aliases in the stdlib.
msg260898 - (view) Author: Alexander Belopolsky (belopolsky) * (Python committer) Date: 2016-02-26 18:13
-1 "foolish consistency" and all that ...

In the context of partial, it is fairly clear that "keywords" means "keyword arguments" while it may not be as clear in other more specialized contexts.  In the age of autocompletion almost everywhere, aliases are harmful because they result in user seeing redundant choices.
History
Date User Action Args
2022-04-11 14:58:27adminsetgithub: 70619
2016-02-26 18:13:18belopolskysetnosy: + belopolsky
messages: + msg260898
2016-02-25 08:16:04serhiy.storchakacreate