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

Function append

prometheus_client/decorator.py:306–320  ·  view source on GitHub ↗

Append ``a`` to the list of the virtual ancestors, unless it is already included.

(a, vancestors)

Source from the content-addressed store, hash-verified

304# ############################ dispatch_on ############################ #
305
306def append(a, vancestors):
307 """
308 Append ``a`` to the list of the virtual ancestors, unless it is already
309 included.
310 """
311 add = True
312 for j, va in enumerate(vancestors):
313 if issubclass(va, a):
314 add = False
315 break
316 if issubclass(a, va):
317 vancestors[j] = a
318 add = False
319 if add:
320 vancestors.append(a)
321
322
323# inspired from simplegeneric by P.J. Eby and functools.singledispatch

Callers 1

vancestorsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected