MCPcopy Index your code
hub / github.com/python/mypy / _is_disjoint_base

Function _is_disjoint_base

mypy/stubtest.py:539–547  ·  view source on GitHub ↗

Return whether a type is a disjoint base at runtime, mirroring CPython's logic in typeobject.c. See PEP 800.

(typ: type[object])

Source from the content-addressed store, hash-verified

537
538
539def _is_disjoint_base(typ: type[object]) -> bool:
540 """Return whether a type is a disjoint base at runtime, mirroring CPython's logic in typeobject.c.
541
542 See PEP 800."""
543 if typ is object:
544 return True
545 base = typ.__base__
546 assert base is not None, f"Type {typ} has no base"
547 return _shape_differs(typ, base)
548
549
550def _verify_disjoint_base(

Callers 1

_verify_disjoint_baseFunction · 0.70

Calls 1

_shape_differsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…