Skip to content

pylint is not happy about _restricted_classmethod #20883

@stefanistrate

Description

@stefanistrate

Bug description

I'm loading my own model with LightningModel.load_from_checkpoint() and running pylint with

$ pylint . --recursive=yes

shows the following error:

scripts/eval_model.py:78:12: E1120: No value for argument 'cls' in unbound method call (no-value-for-parameter)

If I change @_restricted_classmethod to @classmethod in

@_restricted_classmethod
, pylint is happy again. Can you make @_restricted_classmethod work better with pylint?

What version are you seeing the problem on?

master, v2.5

Reproduced in studio

No response

How to reproduce the bug

Error messages and logs

scripts/eval_model.py:78:12: E1120: No value for argument 'cls' in unbound method call (no-value-for-parameter)

Environment

Current environment
#- PyTorch Lightning Version (e.g., 2.5.0): 2.5.1.post0
#- PyTorch Version (e.g., 2.5): 2.2.2
#- Python version (e.g., 3.12): 3.12.9
#- OS (e.g., Linux): macOS
#- CUDA/cuDNN version: N/A
#- GPU models and configuration: N/A
#- How you installed Lightning(`conda`, `pip`, source): pip

More info

No response

cc @lantiga @justusschock

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