-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Description
I got a code that looks like this:
from typing import NamedTuple, Dict, Optional, List, Any
class Object1(object, metaclass=ABCMeta):
def __init__(self) -> None:
pass
@abstractmethod
def get_logo(self) -> Optional[str]:
pass
class Object2(Object1):
def __init__(self) -> None:
super().__init__()
async def get_logo(self) -> Optional[str]:
return ''
class Object3(Object1):
def __init__(self) -> None:
super().__init__()
async def get_logo(self) -> Optional[str]:
return None
And the mypy alerts me that:
test.py:19: error: Return type of "get_logo" incompatible with supertype "Object1"
test.py:27: error: Return type of "get_logo" incompatible with supertype "Object1"
But it's look OK to me, because they return the same type...
I run it with: mypy --strict-optional --ignore-missing-imports <file>
YuvalPruss
Metadata
Metadata
Assignees
Labels
No labels