Skip to content

typing

xsdata.formats.dataclass.typing

is_from_typing(tp)

Return whether the type is from the typing module.

Source code in xsdata/formats/dataclass/typing.py
39
40
41
def is_from_typing(tp: Any) -> bool:
    """Return whether the type is from the typing module."""
    return str(tp).startswith(intern_typing)

evaluate(tp, globalns=None, localns=None)

Analyze/Validate the typing annotation.

Source code in xsdata/formats/dataclass/typing.py
44
45
46
47
48
49
50
def evaluate(
    tp: Any,
    globalns: Any = None,
    localns: Any = None,
) -> Tuple[Type, ...]:
    """Analyze/Validate the typing annotation."""
    return tuple(_evaluate(_eval_type(tp, globalns, localns)))