Skip to content

False positive: multiple-statements (C0321) should not trigger for stub functions #7860

@GideonBear

Description

@GideonBear

Bug description

For example:

class MyClass(ABC):
    @abstractmethod
    def function(self) -> int: ...  # this should not raise `multiple-statements` error as it's a stub

... is technically a statement, but shouldn't be considered one.

If accepted, I would be interested in submitting a PR for this.

Configuration

No response

Command used

N/A

Pylint output

C0321 More than one statement on a single line (multiple-statements)

Expected behavior

No error

Pylint version

pylint 2.16.0-dev
astroid 2.12.13
Python 3.9.15 (main, Nov 11 2022, 13:33:56) 
[GCC 9.4.0]

OS / Environment

No response

Additional dependencies

No response

Metadata

Metadata

Assignees

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

Relationships

None yet

Development

No branches or pull requests

Issue actions