From nmarrow at google.com Thu Nov 2 11:33:16 2017 From: nmarrow at google.com (Nathan Marrow) Date: Thu, 2 Nov 2017 11:33:16 -0400 Subject: [code-quality] pylint: Comprehension Checker Message-ID: Hi, I'd like to write a new checker for pylint to cover the following cases of misused comprehensions (and recommended replacements): - [x for x in y] -> list(y) - any([x for x in y if z]) -> any(x for x in y if z) - all([x for x in y if z]) -> all(x for x in y if z) - [x for x in y if z][0] -> next(x for x in y if z) - set([x for x in y if z]) -> {x for x in y if z} I'm wondering if (1) this functionality already exists somewhere (I couldn't find it), and (2) if not, would you be amenable to a PR that adds such a checker? Thanks, Nathan -------------- next part -------------- An HTML attachment was scrubbed... URL: