Como documentar: rtype: para uma função que retorna vários tipos de dados possíveis? [duplicado

Esta pergunta já tem uma resposta aqui:

Como especificar vários tipos de retorno usando dicas de tipo 2 respostas

Em uma documentação em Python, como se deve documentar o:rtype: para uma função que pode retornar vários tipos de dados possíveis?

Por exemplo, se uma função puder retornardefaultdict ORdict ORlist, com base nos parâmetros das funções, como você documenta isso?

Code example:

from collections import defaultdict

def read_state(state_file, state_file_type='defaultdict'):
    """Deserialize state file or create empty state and return it.

    :param state_file: The path and file name of state file to read.
    :type state_file: str
    :param state_file_type: Data type in which state is stored.
    :type state_file_type: str
    :return: Current or new empty state.
    :rtype: ????? 
    """
    if os.path.exists(state_file):
        with open(state_file) as conf_fo:
            state = json.load(conf_fo)
    elif state_file_type == 'defaultdict':
        state = defaultdict(lambda: defaultdict(list))
    elif state_file_type == 'dict':
        state = {}
    elif state_file_type == 'list':
        state = []
    else:
        raise TypeError("State file type not defined.")
    return state

questionAnswers(2)

yourAnswerToTheQuestion