MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_runtime_checkable_generic

Method test_runtime_checkable_generic

Lib/test/test_typing.py:2886–2899  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2884 class Foo[T]: ...
2885
2886 def test_runtime_checkable_generic(self):
2887 @runtime_checkable
2888 class Foo[T](Protocol):
2889 def meth(self) -> T: ...
2890
2891 class Impl:
2892 def meth(self) -> int: ...
2893
2894 self.assertIsSubclass(Impl, Foo)
2895
2896 class NotImpl:
2897 def method(self) -> int: ...
2898
2899 self.assertNotIsSubclass(NotImpl, Foo)
2900
2901 def test_pep695_generics_can_be_runtime_checkable(self):
2902 @runtime_checkable

Callers

nothing calls this directly

Calls 2

assertIsSubclassMethod · 0.45
assertNotIsSubclassMethod · 0.45

Tested by

no test coverage detected