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

Function inner

src/msgspec/_utils.py:87–103  ·  view source on GitHub ↗
(c, scope)

Source from the content-addressed store, hash-verified

85 cls = obj.__origin__
86
87 def inner(c, scope):
88 if isinstance(c, type):
89 cls = c
90 new_scope = {}
91 else:
92 cls = getattr(c, "__origin__", None)
93 if cls in (None, object, typing.Generic) or cls in mapping:
94 return
95 params = cls.__parameters__
96 args = tuple(_apply_params(a, scope) for a in c.__args__)
97 assert len(params) == len(args)
98 mapping[cls] = new_scope = dict(zip(params, args))
99
100 if issubclass(cls, typing.Generic):
101 bases = getattr(cls, "__orig_bases__", cls.__bases__)
102 for b in bases:
103 inner(b, new_scope)
104
105 inner(obj, {})
106 return cls.__mro__, mapping

Calls 1

_apply_paramsFunction · 0.85

Used in the wild real call sites across dependent graphs

searching dependent graphs…