MCPcopy Create free account
hub / github.com/dagger/dagger / get_meta

Function get_meta

sdk/python/src/dagger/mod/_utils.py:66–75  ·  view source on GitHub ↗

Get metadata from an annotated type.

(obj: Any, match: type[T])

Source from the content-addressed store, hash-verified

64
65
66def get_meta(obj: Any, match: type[T]) -> T | None:
67 """Get metadata from an annotated type."""
68 if is_initvar(obj):
69 return get_meta(obj.type, match)
70 if not is_annotated(obj):
71 return None
72 return next(
73 (arg for arg in reversed(typing.get_args(obj)) if isinstance(arg, match)),
74 None,
75 )
76
77
78def get_doc(obj: Any) -> str | None:

Callers 6

get_docFunction · 0.85
get_ignoreFunction · 0.85
get_default_pathFunction · 0.85
get_default_addressFunction · 0.85
get_alt_nameFunction · 0.85
get_deprecatedFunction · 0.85

Calls 2

is_initvarFunction · 0.85
is_annotatedFunction · 0.85

Tested by

no test coverage detected