jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/529839 )
Change subject: flake8: fix error C412-Unnecessary list comprehension ......................................................................
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(-)
Approvals: Dalba: Looks good to me, approved jenkins-bot: Verified
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:
pywikibot-commits@lists.wikimedia.org