MCPcopy Index your code
hub / github.com/msgspec/msgspec / _apply_params

Function _apply_params

src/msgspec/_utils.py:60–76  ·  view source on GitHub ↗
(obj, mapping)

Source from the content-addressed store, hash-verified

58
59
60def _apply_params(obj, mapping):
61 if isinstance(obj, typing.TypeVar):
62 return mapping.get(obj, obj)
63
64 try:
65 parameters = tuple(obj.__parameters__)
66 except Exception:
67 # Not parameterized or __parameters__ is invalid, ignore
68 return obj
69
70 if not parameters:
71 # Not parametrized
72 return obj
73
74 # Parametrized
75 args = tuple(mapping.get(p, p) for p in parameters)
76 return obj[args]
77
78
79def _get_class_mro_and_typevar_mappings(obj):

Callers 2

innerFunction · 0.85
get_class_annotationsFunction · 0.85

Calls 1

getMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…