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

Function is_nullable

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

Check if the annotation is SomeType | None. Does not support Annotated types. Use only on types that have been resolved with get_type_hints.

(th: TypeHint)

Source from the content-addressed store, hash-verified

144
145
146def is_nullable(th: TypeHint) -> bool:
147 """Check if the annotation is SomeType | None.
148
149 Does not support Annotated types. Use only on types that have been
150 resolved with get_type_hints.
151 """
152 return th.is_bearable(None)
153
154
155def non_null(th: TypeHint) -> TypeHint:

Callers 3

_make_parameterMethod · 0.90
to_typedefFunction · 0.90
test_is_nullableFunction · 0.90

Calls

no outgoing calls

Tested by 1

test_is_nullableFunction · 0.72