Skip to content

When using camel case, private methods with two leading underscores raise invalid-name #10189

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
cwiede opened this issue Jan 17, 2025 · 0 comments · Fixed by #10228
Closed
Labels
False Positive 🦟 A message is emitted but nothing is wrong with the code Needs PR This issue is accepted, sufficiently specified and now needs an implementation
Milestone

Comments

@cwiede
Copy link

cwiede commented Jan 17, 2025

Bug description

class MyClass:
    def __privateMethod(self):
        pass

Configuration

[BASIC]
method-naming-style=camelCase

Command used

pylint a.py

Pylint output

...
a.py:2:4: C0103: Method name "__privateMethod" doesn't conform to camelCase naming style (invalid-name)
...

Expected behavior

I'd expect that the the name __privateMethod should be OK with the camelCase setting.

Pylint version

pylint 3.3.3
astroid 3.3.8
Python 3.9.10 (tags/v3.9.10:f2f3f53, Jan 17 2022, 15:14:21) [MSC v.1929 64 bit (AMD64)]

OS / Environment

No response

Additional dependencies

@cwiede cwiede added the Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling label Jan 17, 2025
@Pierre-Sassoulas Pierre-Sassoulas added False Positive 🦟 A message is emitted but nothing is wrong with the code Needs PR This issue is accepted, sufficiently specified and now needs an implementation and removed Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling labels Jan 17, 2025
@Pierre-Sassoulas Pierre-Sassoulas added this to the 3.3.5 milestone Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
False Positive 🦟 A message is emitted but nothing is wrong with the code Needs PR This issue is accepted, sufficiently specified and now needs an implementation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants