from enum import Enum


def value_to_string(x: object) -> str:
    """
    Returns a string representation of x, with special treatment of Enums (return their value)
    and lists (return comma-separated list).
    :param x: Object to convert to string
    :return: The string representation of the object.
    Special cases: For Enums, returns their value, for lists, returns a comma-separated list.
    """
    if isinstance(x, str):
        return x
    if isinstance(x, Enum):
        # noinspection PyUnresolvedReferences
        return x.value
    if isinstance(x, list):
        return ",".join(value_to_string(item) for item in x)
    return str(x)