Utility to validate a type :
    * None is not allowed,
    * 'object', 'AnyObject' and 'Any' lead to the same 'AnyObject' type
    * JOKER is either rejected (if enforce_not_joker is True, default) or accepted 'as is'

    :param object_type: the type to validate
    :param name: a name used in exceptions if any
    :param enforce_not_joker: a boolean, set to False to tolerate JOKER types
    :return: the fixed type

def get_validated_type(object_type: Type[Any], name: str, enforce_not_joker: bool = True) -> Type[Any]:
    """
    Utility to validate a type :
    * None is not allowed,
    * 'object', 'AnyObject' and 'Any' lead to the same 'AnyObject' type
    * JOKER is either rejected (if enforce_not_joker is True, default) or accepted 'as is'

    :param object_type: the type to validate
    :param name: a name used in exceptions if any
    :param enforce_not_joker: a boolean, set to False to tolerate JOKER types
    :return: the fixed type
    """
    if object_type is object or object_type is Any or object_type is AnyObject:
        return AnyObject
    else:
        # -- !! Do not check TypeVar or Union : this is already handled at higher levels --
        if object_type is JOKER:
            # optionally check if JOKER is allowed
            if enforce_not_joker:
                raise ValueError('JOKER is not allowed for object_type')
        else:
            # note: we dont check var earlier, since 'typing.Any' is not a subclass of type anymore
            check_var(object_type, var_types=type, var_name=name)
        return object_type