MCPcopy Index your code
hub / github.com/prometheus/client_python / ancestors

Function ancestors

prometheus_client/decorator.py:360–377  ·  view source on GitHub ↗

Get a list of virtual MROs, one for each type

(*types)

Source from the content-addressed store, hash-verified

358 return [set(ra) for ra in ras]
359
360 def ancestors(*types):
361 """
362 Get a list of virtual MROs, one for each type
363 """
364 check(types)
365 lists = []
366 for t, vas in zip(types, vancestors(*types)):
367 n_vas = len(vas)
368 if n_vas > 1:
369 raise RuntimeError(
370 'Ambiguous dispatch for %s: %s' % (t, vas))
371 elif n_vas == 1:
372 va, = vas
373 mro = type('t', (t, va), {}).__mro__[1:]
374 else:
375 mro = t.__mro__
376 lists.append(mro[:-1]) # discard t and object
377 return lists
378
379 def register(*types):
380 """

Callers 2

dispatch_infoFunction · 0.85
_dispatchFunction · 0.85

Calls 2

checkFunction · 0.85
vancestorsFunction · 0.85

Tested by

no test coverage detected