jenkins-bot merged this change.

View Change

Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
[doc] Fix several doc warnings caused by @deprecated_args

@deprecated_args adds deprecated parameters to method's internal
OrderedDict for parameters. The order is the order of addition, which
adds POSITIONAL-OR-KEYWORD kind parameters after *args, KEYWORD-ONLY
kind parameters and **kwargs.

Sort OrderedDict according to parameters' kind there should fix
the issue.

See also:
https://docs.python.org/3/library/inspect.html#inspect.Parameter.kind

Bug: T244674
Change-Id: I40528a8e67c6a64730b35ad050bfbe4f521c270d
---
M pywikibot/tools/__init__.py
1 file changed, 2 insertions(+), 0 deletions(-)

diff --git a/pywikibot/tools/__init__.py b/pywikibot/tools/__init__.py
index a4d2219..6c6b364 100644
--- a/pywikibot/tools/__init__.py
+++ b/pywikibot/tools/__init__.py
@@ -1806,6 +1806,8 @@
default='[deprecated name of ' + new_arg + ']'
if new_arg not in [True, False, None]
else NotImplemented)
+ params = collections.OrderedDict(sorted(params.items(),
+ key=lambda x: x[1].kind))
wrapper.__signature__ = inspect.Signature()
wrapper.__signature__._parameters = params


To view, visit change 583058. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I40528a8e67c6a64730b35ad050bfbe4f521c270d
Gerrit-Change-Number: 583058
Gerrit-PatchSet: 5
Gerrit-Owner: Dvorapa <dvorapa@seznam.cz>
Gerrit-Reviewer: Dvorapa <dvorapa@seznam.cz>
Gerrit-Reviewer: Xqt <info@gno.de>
Gerrit-Reviewer: jenkins-bot (75)