Skip to content

Commit

Permalink
Attempt to reproduce #91
Browse files Browse the repository at this point in the history
  • Loading branch information
kedder committed Feb 10, 2023
1 parent 6945ee0 commit 5de7f20
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions tests/samples/isinstance_impl.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
from typing import Optional
from zope.interface import implementer, Interface


class IFoo(Interface):
...


@implementer(IFoo)
class MyFoo:
...


def make_foo() -> Optional[IFoo]:
return MyFoo()


x = make_foo()
reveal_type(x)
assert isinstance(x, MyFoo)

# The code below should not be considered unreachable
print("hello")

"""
<output>
isinstance_impl.py:19: note: Revealed type is "Union[__main__.IFoo, None]"
</output>
"""

0 comments on commit 5de7f20

Please sign in to comment.