-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
bugmypy got something wrongmypy got something wrongfalse-positivemypy gave an error on correct codemypy gave an error on correct codetopic-type-variables
Description
- Are you reporting a bug, or opening a feature request? Bug
- Please insert below the code you are checking with mypy,
from typing import TypeVar, Type
T = TypeVar("T", bound="A")
class A:
@classmethod
def foo(cls: Type[T]) -> T:
print(cls.__qualname__)
return cls()
class B(A):
@classmethod
def foo(cls: Type[T]) -> T:
return super().foo()
B.foo()
- What is the actual behavior/output?
scratch.py:14: error: Returning Any from function declared to return "T"
scratch.py:14: error: Argument 2 for "super" not an instance of argument 1
- What are the versions of mypy and Python you are using?
Python 3.8.5
mypy 0.790+dev.5e9682143720263466f0aaed1924ccb218160ee0
Do you see the same issue after installing mypy from Git master? Yes - What are the mypy flags you are using? --strict
RonVider, jtschoonhoven, gilad-orca, owiefawefoeiwf, Talendar and 15 moreor-orca and adar-orcaor-orca and adar-orca
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrongfalse-positivemypy gave an error on correct codemypy gave an error on correct codetopic-type-variables