def getid(thing: object, module: str=None, qualname: str=None, name: str=None
    ) ->str:
    """Returns some kind of id for `thing`

    :param thing: object to get the id for

    :param module: str fallback

    :param qualname: str fallback

    :param name: str fallback    """
    parts = []
    module = getattr(thing, '__module__', module)
    name = getattr(thing, '__qualname__', None) or getattr(thing,
        '__name__', name)
    if module:
        parts.append(module)
    if name:
        parts.append(name)
    return '.'.join(parts)
