Skip to content

Commit

Permalink
fail
Browse files Browse the repository at this point in the history
  • Loading branch information
DetachHead committed Nov 18, 2024
1 parent 29b9759 commit 7f1d22e
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Any, Never, assert_type, Iterable
from typing import Any, Never, assert_type, Iterable, Iterator, MutableMapping, Reversible


class Covariant[T]:
Expand Down Expand Up @@ -66,3 +66,7 @@ def unknown(self, value):
def partially_unknown(self, value=None):
if isinstance(value, Iterable):
assert_type(value, Iterable[Any])

def foo[KT,VT](self: MutableMapping[KT, VT]) -> Iterator[KT]:
assert isinstance(self, Reversible) # fail
return reversed(self)

0 comments on commit 7f1d22e

Please sign in to comment.