import inspect


def get_channelmethods(obj):
    """
    Returns a sorted list of the names of all channelmethods defined for an object.
    """
    channelmethods = list()
    # getmembers() returns a list of tuples already sorted by name
    for name, method in inspect.getmembers(obj, inspect.ismethod):
        # To be a channelmethod, the method must have an attribute called `is_channelmethod`,
        # *and* it must be bound to the object, since it is common for channelmethods from one
        # channel manager to be passed into the constructor of a subsequent channel manager!
        if hasattr(method, 'is_channelmethod') and (method.__self__ == obj):
            channelmethods.append(name)
    return tuple(channelmethods)