def reprhandler(handler):
    format = "<handler[%s][%s]%s (%s.%s)>"

    channel = getattr(handler, "channel", "*")
    if channel is None:
        channel = "*"

    from circuits.core.manager import Manager
    if isinstance(channel, Manager):
        channel = "<instance of " + channel.__class__.__name__ + ">"

    names = ",".join(handler.names)

    instance = getattr(
        handler, "im_self", getattr(
            handler, "__self__", Unknown()
        )
    ).__class__.__name__

    method = handler.__name__

    priority = "[%0.2f]" % (handler.priority,) if handler.priority else ""

    return format % (channel, names, priority, instance, method)
dataset/ETHPy150Open circuits/circuits/circuits/core/handlers.py/reprhandler/original