from typing import List
from typing import Union


def _unicode_def_src_to_str(srclist: List[Union[str, int]]) -> str:
    """
    Used to create :data:`UNICODE_CATEGORY_STRINGS`.

    Args:
        srclist: list of integers or hex range strings like ``"0061-007A"``

    Returns:
        a string with all characters described by ``srclist``: either the
        character corresponding to the integer Unicode character number, or
        all characters corresponding to the inclusive range described
    """
    charlist = []  # type: List[str]
    for src in srclist:
        if isinstance(src, int):
            charlist.append(chr(src))
        else:
            # Range like "0041-005A"
            first, last = [int(x, 16) for x in src.split("-")]
            charlist += [chr(x) for x in range(first, last + 1)]
    return "".join(charlist)