You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from contextlib import contextmanager
from typing import Iterator
class Foo(object):
@contextmanager
def bar(self):
# type: () -> Iterator[int]
yield 4
class Bar(Foo):
@contextmanager
def bar(self):
# type: () -> Iterator[int]
yield 3
reveal_type(Foo.bar)
reveal_type(Bar.bar)
Fails thus:
t5.py: note: In class "Bar":
t5.py:12: error: Signature of "bar" incompatible with supertype "Foo"
t5.py: note: At top level:
t5.py:17: error: Revealed type is 'def (*Any, **Any) -> contextlib.ContextManager[builtins.int*]'
t5.py:18: error: Revealed type is 'def (*Any, **Any) -> contextlib.ContextManager[builtins.int*]'
The text was updated successfully, but these errors were encountered:
tmp.py:12: error: Signature of "bar" incompatible with supertype "Foo"
tmp.py:16: error: Revealed type is 'Any'
tmp.py:17: error: Revealed type is 'Any'
Fails thus:
The text was updated successfully, but these errors were encountered: