Skip to content

unused-private-member/W0238 about privates or mangling? #9356

Open
@dpinol

Description

@dpinol

Current problem

According to https://pylint.readthedocs.io/en/latest/user_guide/messages/warning/unused-private-member.html, it is

Emitted when a private member of a class is defined but not used.

However, the example code is

  def __print_color(self):  # [unused-private-member]
        pass

which is not a private member, but a method with mangled named according to https://realpython.com/python-double-underscore/#double-leading-underscore-in-classes-pythons-name-mangling. According to the same source, private members start with a single underscore

Desired solution

W0238 should affect private members (starting with a single underscore)

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions