Skip to content

Pylint: chained-comparison #14

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

Closed
evaherrada opened this issue Mar 15, 2020 · 2 comments
Closed

Pylint: chained-comparison #14

evaherrada opened this issue Mar 15, 2020 · 2 comments

Comments

@evaherrada
Copy link
Collaborator

************* Module adafruit_miniqr
adafruit_miniqr.py:160:21: R1716: Simplify chained comparison between the operands (chained-comparison)
adafruit_miniqr.py:161:24: R1716: Simplify chained comparison between the operands (chained-comparison)
adafruit_miniqr.py:162:24: R1716: Simplify chained comparison between the operands (chained-comparison)

And the code:

159                test = (
160                    (r >= 0 and r <= 6 and (c in (0, 6)))
161                   or (c >= 0 and c <= 6 and (r in (0, 6)))
162                    or (r >= 2 and r <= 4 and c >= 2 and c <= 4)
163                )

I think that in this case, it might just be better to add some pylint disables. I can't think of a cleaner way to do this, however I would assume there is one.

Referencing main issue: adafruit/Adafruit_CircuitPython_Bundle#232
@kattni

@jepler
Copy link
Contributor

jepler commented Mar 16, 2020

Isn't it asking you to write e.g. 0 <= r <= 6 for the first two r comparisons

@kattni kattni closed this as completed Mar 17, 2020
@evaherrada
Copy link
Collaborator Author

Reopening and then quickly closing this to see if I can get it to go away from my 'open' issues section

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants