MCPcopy Create free account
hub / github.com/apache/fory / _is_dynamic_nullable_default

Function _is_dynamic_nullable_default

python/pyfory/struct.py:149–156  ·  view source on GitHub ↗
(type_hint: type)

Source from the content-addressed store, hash-verified

147
148
149def _is_dynamic_nullable_default(type_hint: type) -> bool:
150 if type_hint is typing.Any:
151 return True
152 origin = _get_origin(type_hint)
153 args = _get_args(type_hint)
154 if origin in (list, dict, set, tuple) and not args:
155 return True
156 return type_hint in (list, dict, set, tuple, typing.List, typing.Dict, typing.Set, typing.Tuple)
157
158
159def _default_field_meta(type_hint: type, field_nullable: bool = False, xlang: bool = False) -> ForyFieldMeta:

Callers 1

_default_field_metaFunction · 0.85

Calls 2

_get_originFunction · 0.90
_get_argsFunction · 0.90

Tested by

no test coverage detected