Skip to content

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

Open
@cwiede

Description

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

Metadata

Assignees

No one assigned

    Labels

    False Positive 🦟A message is emitted but nothing is wrong with the codeNeeds PRThis issue is accepted, sufficiently specified and now needs an implementation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions