snipy/basic.py
def optional_str(deco):
    """
    string 1개만 deco 인자로 오거나 없거나.
    :param deco:
    :return:
    """

    @wraps(deco)
    def dispatcher(*args, **kwargs):

        # when only function arg
        if not kwargs and len(args) == 1 and not isinstance(args[0], str) \
                and args[0] is not None:
            decorator = deco()
            return decorator(args[0])
        else:
            # decorator with args
            decorator = deco(*args, **kwargs)
            return decorator

    return dispatcher
def optional_str(deco):
    """
    string 1개만 deco 인자로 오거나 없거나.
    :param deco:
    :return:
    """

    @wraps(deco)
    def dispatcher(*args, **kwargs):

        # when only function arg
        if not kwargs and len(args) == 1 and not isinstance(args[0], str) \
                and args[0] is not None:
            decorator = deco()
            return decorator(args[0])
        else:
            # decorator with args
            decorator = deco(*args, **kwargs)
            return decorator

    return dispatcher
string 1개만 deco 인자로 오거나 없거나.
    :param deco:
    :return: