pylint
pylint copied to clipboard
Pylint is not smart enough when analyzes functions returning coroutine.
Bug description
from asyncio import sleep
from typing import Any, Awaitable, Coroutine
class A:
async def fun(self) -> None:
pass
class B(A):
def fun(self) -> Awaitable[None]:
return sleep(42)
class C(A):
def fun(self) -> Coroutine[Any, Any, None]:
return sleep(42)
Configuration
No response
Command used
pylint a.py
Pylint output
W0236: Method 'fun' was expected to be 'async', found it instead as 'non-async' (invalid-overridden-method)
Expected behavior
no warnings/errors
Pylint version
pylint 3.0.4
astroid 3.0.3
Python 3.12.3 (main, Apr 17 2024, 00:00:00) [GCC 13.2.1 20240316 (Red Hat 13.2.1-7)]
OS / Environment
Fedora 39
Additional dependencies
No response