Skip to content

Fix code triggering superfluous-parens pylint messages #49219

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 3 commits into from
Oct 24, 2022

Conversation

Leviob
Copy link
Contributor

@Leviob Leviob commented Oct 20, 2022

There were several locations where superfluous parentheses were being used to clarify the operator precedence in potentially ambiguous situations. Parentheses were removed and the code was refactored to add clarity where relevant.

This code structure was a little confusing:

        assert not (left == right)
        assert left != right

I decided to remove the first line altogether, since it seems unnecessary. If it does serve a purpose, I can add it back.

A duplicate "too-many-locals" was also removed from 'pyproject.toml'.

Copy link
Member

@mzeitlin11 mzeitlin11 left a comment

Choose a reason for hiding this comment

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

Thanks @Leviob! Two comments where I thought test code should be kept, otherwise LGTM

@mzeitlin11 mzeitlin11 added the Code Style Code style, linting, code_checks label Oct 20, 2022
@mroeschke mroeschke added this to the 2.0 milestone Oct 24, 2022
@mroeschke mroeschke merged commit a2d5564 into pandas-dev:main Oct 24, 2022
@mroeschke
Copy link
Member

Thanks @Leviob

noatamir pushed a commit to noatamir/pandas that referenced this pull request Nov 9, 2022
)

* Fix code triggering superfluous-parens pylint messages

* Add previously removed asserts to tests

* Refactor CustomClass test to avoid using >=
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Style Code style, linting, code_checks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants