MCPcopy Index your code
hub / github.com/python/cpython / test_bundled_protocol_instance_works

Method test_bundled_protocol_instance_works

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

Source from the content-addressed store, hash-verified

4363 self.assertNotIsSubclass(str, typing.SupportsIndex)
4364
4365 def test_bundled_protocol_instance_works(self):
4366 self.assertIsInstance(0, typing.SupportsAbs)
4367 class C1(typing.SupportsInt):
4368 def __int__(self) -> int:
4369 return 42
4370 class C2(C1):
4371 pass
4372 c = C2()
4373 self.assertIsInstance(c, C1)
4374
4375 def test_collections_protocols_allowed(self):
4376 @runtime_checkable

Callers

nothing calls this directly

Calls 2

assertIsInstanceMethod · 0.80
C2Class · 0.70

Tested by

no test coverage detected