Skip to content

General issue - py/not-named-cls should trigger for implicit class methods #2826

Open
@Jackenmen

Description

@Jackenmen

Description of the issue

py/not-named-cls should trigger for wrong first arg name for special method names that implicitly make the methods class methods.
For example:

class Example:
    def __init_subclass__(self):  # should error and say to use `cls` instead
        pass

    def __class_getitem__(self):  # should error and say to use `cls` instead
        pass

Metadata

Metadata

Assignees

No one assigned

    Labels

    PythonquestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions