Skip to content
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

Regression protected-access not recognized #5989

Closed
cdce8p opened this issue Mar 26, 2022 · 0 comments · Fixed by #5990
Closed

Regression protected-access not recognized #5989

cdce8p opened this issue Mar 26, 2022 · 0 comments · Fixed by #5990
Assignees
Labels
False Negative 🦋 No message is emitted but something is wrong with the code Regression
Milestone

Comments

@cdce8p
Copy link
Member

cdce8p commented Mar 26, 2022

class Light:
    @property
    def _light_internal(self) -> set[str]:
        return set()


def func(light: Light) -> None:
    print(light._light_internal)  # should emit 'protected-access' error

Error in pylint 2.12.2, not recognized in 2.13.0

W0212: Access to a protected member _light_internal of a client class (protected-access)

The issue is caused by a change in #5662. In particular the one in _is_mandatory_method_param which prevents the protected-access check from running.
https://github.com/PyCQA/pylint/blob/556304eb1e54c67940d0f9d0497ffa368b50a22a/pylint/checkers/classes/class_checker.py#L2105-L2122

https://github.com/PyCQA/pylint/blob/556304eb1e54c67940d0f9d0497ffa368b50a22a/pylint/checkers/classes/class_checker.py#L1470-L1476

/CC: @jacobtylerwalls

@cdce8p cdce8p added Regression False Negative 🦋 No message is emitted but something is wrong with the code labels Mar 26, 2022
@cdce8p cdce8p added this to the 2.13.2 milestone Mar 26, 2022
@jacobtylerwalls jacobtylerwalls self-assigned this Mar 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
False Negative 🦋 No message is emitted but something is wrong with the code Regression
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants