jenkins-bot merged this change.

View Change

Approvals: Dalba: Looks good to me, approved jenkins-bot: Verified
flake8: fix error C412-Unnecessary list comprehension

Fix flake8 error:
- C412 Unnecessary list comprehension - 'in' can take a generator.

Change-Id: I2d64b7e97d4683fa93441e48e12deac91d0d859a
---
M pywikibot/site.py
M scripts/interwiki.py
2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/pywikibot/site.py b/pywikibot/site.py
index d66b5d2..53928d7 100644
--- a/pywikibot/site.py
+++ b/pywikibot/site.py
@@ -255,7 +255,7 @@

@rtype: bool
"""
- return name in [x.lower() for x in self._distinct()]
+ return name in (x.lower() for x in self._distinct())

def __contains__(self, item):
"""Determine if item is a name of this namespace.
@@ -4382,7 +4382,7 @@

def isBot(self, username):
"""Return True is username is a bot user."""
- return username in [userdata['name'] for userdata in self.botusers()]
+ return username in (userdata['name'] for userdata in self.botusers())

@deprecated_args(step=None)
def botusers(self, total=None):
diff --git a/scripts/interwiki.py b/scripts/interwiki.py
index 3e521c5..3a1d7f0 100755
--- a/scripts/interwiki.py
+++ b/scripts/interwiki.py
@@ -1355,8 +1355,8 @@
# Ignore the interwiki links.
iw = ()
if self.conf.lacklanguage:
- if self.conf.lacklanguage in [link.site.lang
- for link in iw]:
+ if self.conf.lacklanguage in (link.site.lang
+ for link in iw):
iw = ()
self.workonme = False
if len(iw) < self.conf.minlinks:

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

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I2d64b7e97d4683fa93441e48e12deac91d0d859a
Gerrit-Change-Number: 529839
Gerrit-PatchSet: 1
Gerrit-Owner: Mpaa <mpaa.wiki@gmail.com>
Gerrit-Reviewer: D3r1ck01 <xsavitar.wiki@aol.com>
Gerrit-Reviewer: Dalba <dalba.wiki@gmail.com>
Gerrit-Reviewer: Dvorapa <dvorapa@seznam.cz>
Gerrit-Reviewer: John Vandenberg <jayvdb@gmail.com>
Gerrit-Reviewer: Mpaa <mpaa.wiki@gmail.com>
Gerrit-Reviewer: Xqt <info@gno.de>
Gerrit-Reviewer: Zhuyifei1999 <zhuyifei1999@gmail.com>
Gerrit-Reviewer: jenkins-bot (75)