Skip to content

Extended consider-using-tuple check to cover in comparisons #4768

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 29, 2021

Conversation

cdce8p
Copy link
Member

@cdce8p cdce8p commented Jul 28, 2021

Type of Changes

Type
✨ New feature

Description

Extend consider-using-tuple check from the CodeStyleChecker extension to recognize lists / sets in in comparisons.

Some examples

x in [1, 2, 3]  # [consider-using-tuple]

if x in [1, 2, 3]:  # [consider-using-tuple]
    pass

assert x in {1, 2, 3}  # [consider-using-tuple]

Previously the check was only used inside For looks and Comprehensions.

@cdce8p cdce8p added the Enhancement ✨ Improvement to a component label Jul 28, 2021
@cdce8p cdce8p added this to the 2.10.0 milestone Jul 28, 2021
@cdce8p cdce8p force-pushed the cs_consider-using-tuple-2 branch from ba3618e to 9fcb74b Compare July 28, 2021 23:28
@cdce8p cdce8p requested a review from Pierre-Sassoulas July 28, 2021 23:28
@coveralls
Copy link

coveralls commented Jul 28, 2021

Coverage Status

Coverage increased (+0.003%) to 92.252% when pulling 244055c on cdce8p:cs_consider-using-tuple-2 into 68a22eb on PyCQA:main.

@cdce8p cdce8p force-pushed the cs_consider-using-tuple-2 branch from 3df9adb to e2817f7 Compare July 28, 2021 23:34
Copy link
Member

@Pierre-Sassoulas Pierre-Sassoulas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done!

@cdce8p cdce8p force-pushed the cs_consider-using-tuple-2 branch from 0e6e666 to 244055c Compare July 29, 2021 12:00
@cdce8p cdce8p merged commit ca3bc53 into pylint-dev:main Jul 29, 2021
@cdce8p cdce8p deleted the cs_consider-using-tuple-2 branch July 29, 2021 14:38
cdce8p added a commit to cdce8p/pylint that referenced this pull request Aug 12, 2021
cdce8p added a commit that referenced this pull request Aug 12, 2021
Revert "Extended consider-using-tuple check to cover 'in' comparisons (#4768)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement ✨ Improvement to a component
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants