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
_______________________________________________
code-quality mailing list
code-quality@python.org
https://mail.python.org/mailman/listinfo/code-quality

Reply via email to