jenkins-bot has submitted this change. (
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/673703 )
Change subject: [fix] remove unnecessary parentheses
......................................................................
[fix] remove unnecessary parentheses
Change-Id: Ia251332edc80c8436dfc337051c10b448567e178
---
M pywikibot/__init__.py
M pywikibot/date.py
M pywikibot/page/__init__.py
M pywikibot/textlib.py
M pywikibot/tools/chars.py
M scripts/category_redirect.py
6 files changed, 9 insertions(+), 9 deletions(-)
Approvals:
Matěj Suchánek: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/__init__.py b/pywikibot/__init__.py
index 5d149b5..0ac60bb 100644
--- a/pywikibot/__init__.py
+++ b/pywikibot/__init__.py
@@ -128,7 +128,7 @@
@param sep: one-character separator, placed between the date and time
@return: ISO8601 format string
"""
- assert(len(sep) == 1)
+ assert len(sep) == 1
return '%Y-%m-%d{0}%H:%M:%SZ'.format(sep)
@classmethod
diff --git a/pywikibot/date.py b/pywikibot/date.py
index a825e67..1b98c0d 100644
--- a/pywikibot/date.py
+++ b/pywikibot/date.py
@@ -1898,10 +1898,10 @@
for monthId in range(12):
- if (monthId + 1) in (1, 3, 5, 7, 8, 10, 12):
+ if monthId + 1 in (1, 3, 5, 7, 8, 10, 12):
# 31 days a month
formatLimits[dayMnthFmts[monthId]] = _format_limit_dom(31)
- elif (monthId + 1) == 2: # February
+ elif monthId + 1 == 2: # February
# 29 days a month
formatLimits[dayMnthFmts[monthId]] = _format_limit_dom(29)
else:
diff --git a/pywikibot/page/__init__.py b/pywikibot/page/__init__.py
index 233113f..cef51d6 100644
--- a/pywikibot/page/__init__.py
+++ b/pywikibot/page/__init__.py
@@ -2914,7 +2914,7 @@
@param force: if True, forces reloading the data from API
"""
- return (not self.isAnonymous() and 'emailable' in self.getprops(force))
+ return not self.isAnonymous() and 'emailable' in self.getprops(force)
def groups(self, force: bool = False) -> list:
"""
diff --git a/pywikibot/textlib.py b/pywikibot/textlib.py
index c72c9b0..4142122 100644
--- a/pywikibot/textlib.py
+++ b/pywikibot/textlib.py
@@ -537,7 +537,7 @@
marker = findmarker(text)
text = text[:index] + marker + text[index:]
text = removeDisabledParts(text, tags)
- return (marker not in text)
+ return marker not in text
def findmarker(text: str, startwith: str = '@@',
diff --git a/pywikibot/tools/chars.py b/pywikibot/tools/chars.py
index adc93cf..a31ab23 100644
--- a/pywikibot/tools/chars.py
+++ b/pywikibot/tools/chars.py
@@ -1,6 +1,6 @@
"""Character based helper functions (not
wiki-dependent)."""
#
-# (C) Pywikibot team, 2015-2020
+# (C) Pywikibot team, 2015-2021
#
# Distributed under the terms of the MIT license.
#
@@ -27,8 +27,8 @@
match = match.group()
if sys.maxunicode < 0x10ffff and len(match) == 2:
mask = (1 << 10) - 1
- assert(ord(match[0]) & ~mask == 0xd800)
- assert(ord(match[1]) & ~mask == 0xdc00)
+ assert ord(match[0]) & ~mask == 0xd800
+ assert ord(match[1]) & ~mask == 0xdc00
codepoint = (ord(match[0]) & mask) << 10 | (ord(match[1]) &
mask)
else:
codepoint = ord(match)
diff --git a/scripts/category_redirect.py b/scripts/category_redirect.py
index 9563b1b..c4baf3c 100755
--- a/scripts/category_redirect.py
+++ b/scripts/category_redirect.py
@@ -177,7 +177,7 @@
deadline = today + timedelta(days=-self.opt.delay)
if cat.editTime() is None:
raise RuntimeError
- return (deadline > cat.editTime())
+ return deadline > cat.editTime()
def get_log_text(self):
"""Rotate log text and return the most recent
text."""
--
To view, visit
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/673703
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: Ia251332edc80c8436dfc337051c10b448567e178
Gerrit-Change-Number: 673703
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: D3r1ck01 <xsavitar.wiki(a)aol.com>
Gerrit-Reviewer: Matěj Suchánek <matejsuchanek97(a)gmail.com>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged