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

Function is_trivial_bound

mypy/solve.py:383–386  ·  view source on GitHub ↗
(tp: ProperType, allow_tuple: bool = False)

Source from the content-addressed store, hash-verified

381
382
383def is_trivial_bound(tp: ProperType, allow_tuple: bool = False) -> bool:
384 if isinstance(tp, Instance) and tp.type.fullname == "builtins.tuple":
385 return allow_tuple and is_trivial_bound(get_proper_type(tp.args[0]))
386 return isinstance(tp, Instance) and tp.type.fullname == "builtins.object"
387
388
389def find_linear(c: Constraint) -> tuple[bool, TypeVarId | None]:

Callers 1

choose_freeFunction · 0.85

Calls 2

get_proper_typeFunction · 0.90
isinstanceFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…