jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/511680 )
Change subject: [IMPR] Simplify tuple expression ......................................................................
[IMPR] Simplify tuple expression
also use private function _make_parameter directly
Change-Id: I99f03f3c1f329b03838fb3faad2272da7bebe959 --- M pywikibot/date.py 1 file changed, 4 insertions(+), 7 deletions(-)
Approvals: Framawiki: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/date.py b/pywikibot/date.py index b2da643..3f3a8c1 100644 --- a/pywikibot/date.py +++ b/pywikibot/date.py @@ -465,23 +465,20 @@
params = encf(value)
- # name 'MakeParameter' kept to avoid breaking blame below - MakeParameter = _make_parameter - if type(params) in _listTypes: assert len(params) == len(decoders), ( 'parameter count ({0}) does not match decoder count ({1})' .format(len(params), len(decoders))) # convert integer parameters into their textual representation - params = [MakeParameter(decoders[i], param) - for i, param in enumerate(params)] - return strPattern % tuple(params) + params = tuple(_make_parameter(decoders[i], param) + for i, param in enumerate(params)) + return strPattern % params else: assert len(decoders) == 1, ( 'A single parameter does not match {0} decoders.' .format(len(decoders))) # convert integer parameter into its textual representation - return strPattern % MakeParameter(decoders[0], params) + return strPattern % _make_parameter(decoders[0], params)
def _make_parameter(decoder, param):