jenkins-bot has submitted this change. (
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/759885 )
Change subject: [IMPR] simplify range call
......................................................................
[IMPR] simplify range call
Start parameter can be omitted if it is 0 and no step parameter is given.
Change-Id: I18899a2fc8994ba4d4be71208af1b01b98cba88b
---
M pywikibot/date.py
M pywikibot/textlib.py
M tests/namespace_tests.py
3 files changed, 4 insertions(+), 4 deletions(-)
Approvals:
Mpaa: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/date.py b/pywikibot/date.py
index 4b7763f..b6f4a42 100644
--- a/pywikibot/date.py
+++ b/pywikibot/date.py
@@ -1,6 +1,6 @@
"""Date data and manipulation module."""
#
-# (C) Pywikibot team, 2003-2021
+# (C) Pywikibot team, 2003-2022
#
# Distributed under the terms of the MIT license.
#
@@ -1860,7 +1860,7 @@
# Brazil uses '1añ' for the 1st of every month, and number without suffix for
# all other days
brMonthNames = makeMonthNamedList('br', '%s', True)
-for i in range(0, 12):
+for i in range(12):
formats[dayMnthFmts[i]]['br'] = eval(
'lambda m: multi(m, ['
'(lambda v: dh_dayOfMnth(v, "%dañ {mname}"), lambda p: p == 1), '
diff --git a/pywikibot/textlib.py b/pywikibot/textlib.py
index da69210..d8d1384 100644
--- a/pywikibot/textlib.py
+++ b/pywikibot/textlib.py
@@ -1905,7 +1905,7 @@
def fix_digits(self, line):
"""Make non-latin digits like Persian to latin to parse."""
for system in NON_LATIN_DIGITS.values():
- for i in range(0, 10):
+ for i in range(10):
line = line.replace(system[i], str(i))
return line
diff --git a/tests/namespace_tests.py b/tests/namespace_tests.py
index 401e502..8a511c0 100644
--- a/tests/namespace_tests.py
+++ b/tests/namespace_tests.py
@@ -68,7 +68,7 @@
ns = Namespace.builtin_namespaces()
self.assertIsInstance(ns, dict)
- self.assertTrue(all(x in ns for x in range(0, 16)))
+ self.assertTrue(all(x in ns for x in range(16)))
self.assertTrue(all(isinstance(key, int)
for key in ns))
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/759885
To unsubscribe, or for help writing mail filters, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I18899a2fc8994ba4d4be71208af1b01b98cba88b
Gerrit-Change-Number: 759885
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: Mpaa <[email protected]>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]