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

Method __subclasshook__

Lib/test/test_typing.py:3908–3909  ·  view source on GitHub ↗
(cls, other)

Source from the content-addressed store, hash-verified

3906 class C(P):
3907 @classmethod
3908 def __subclasshook__(cls, other):
3909 return other.__name__.startswith("OK")
3910
3911 self.assertIsInstance(OKClass(), C)
3912 self.assertNotIsInstance(BadClass(), C)

Callers

nothing calls this directly

Calls 1

startswithMethod · 0.45

Tested by

no test coverage detected