jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/583058 )
Change subject: [doc] Fix several doc warnings caused by @deprecated_args ......................................................................
[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(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
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
pywikibot-commits@lists.wikimedia.org