Issue 26432: Add partial.kwargs - Python tracker (original) (raw)

Issue26432

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:27 admin set github: 70619
2016-02-26 18:13:18 belopolsky set nosy: + belopolskymessages: +
2016-02-25 08:16:04 serhiy.storchaka create