Open
Description
Bug description
from dataclasses import dataclass
from typing import Protocol
class Blah(Protocol):
def do_thing(self) -> str:
...
@dataclass
class BlahUser:
blah: Blah
def do_thing_with_blah(self):
value = self.blah.do_thing()
return value
Pylint's assignment-from-no-return
rule issues the following error
Assigning result of a function call, where the function has no return
But Blah
is a protocol, there's no expectation it should return.
I can raise
in the body of Blah
instead. Not using dataclass
is another alternative.
Configuration
No response
Command used
I received this error through the Pylint VS Code extension
Pylint output
Assigning result of a function call, where the function has no return
Expected behavior
I would expect no error.
Pylint version
v2023.7.12711014
OS / Environment
Ubuntu Linux
Additional dependencies
No response