def _type_repr(obj):
    'Return the repr() of an object, special-casing types (internal helper).\n    If obj is a type, we return a shorter version than the default\n    type.__repr__, based on the module and qualified name, which is\n    typically enough to uniquely identify a type.  For everything\n    else, we fall back on repr(obj).\n    '
    if (isinstance(obj, type) and (obj.__module__ != 'typing')):
        if (obj.__module__ == 'builtins'):
            return obj.__qualname__
        return f'{obj.__module__}.{obj.__qualname__}'
    if (obj is ...):
        return '...'
    if isinstance(obj, types.FunctionType):
        return obj.__name__
    return repr(obj)
Return the repr() of an object, special-casing types (internal helper).
If obj is a type, we return a shorter version than the default
type.__repr__, based on the module and qualified name, which is
typically enough to uniquely identify a type.  For everything
else, we fall back on repr(obj).
def _type_repr(obj):
    'Return the repr() of an object, special-casing types (internal helper).\n    If obj is a type, we return a shorter version than the default\n    type.__repr__, based on the module and qualified name, which is\n    typically enough to uniquely identify a type.  For everything\n    else, we fall back on repr(obj).\n    '
    if (isinstance(obj, type) and (obj.__module__ != 'typing')):
        if (obj.__module__ == 'builtins'):
            return obj.__qualname__
        return f'{obj.__module__}.{obj.__qualname__}'
    if (obj is ...):
        return '...'
    if isinstance(obj, types.FunctionType):
        return obj.__name__
    return repr(obj)