- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 3k
Open
Labels
bugmypy got something wrongmypy got something wrongfalse-positivemypy gave an error on correct codemypy gave an error on correct codepriority-1-normaltopic-join-v-unionUsing join vs. using unionsUsing join vs. using unions
Description
Mypy complains about the following code even though it looks fine:
from abc import abstractmethod
class Base:
    @abstractmethod
    def f(self) -> None: pass
class A(Base):
    def f(self) -> None: pass
class B(Base):
    def f(self) -> None: pass
t = [A, B]
t[0]()  # Cannot instantiate abstract class 'Base' with abstract attribute 'f'It looks like the join of two callables representing type objects should perhaps be Type[x] instead of another callable, since mypy basically assumes that a callable represents a specific type object, not something that can also be any subclass. The same issue probably applies to meets as well.
aberres, rafalcieslak, raphael-riel, juliarizza, quercus-benchling and 11 more
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrongfalse-positivemypy gave an error on correct codemypy gave an error on correct codepriority-1-normaltopic-join-v-unionUsing join vs. using unionsUsing join vs. using unions