import inspect


def formatArgs(obj, strip_self=False):
    """Return a formatted version of the object's argument list, enclosed in
    parentheses.

    If *strip_self* is true, strip the "self" argument if present.
    """
    sig = inspect.signature(obj)
    if strip_self and 'self' in sig.parameters:
        sig = sig.replace(parameters=[p for p in sig.parameters.values()
                                      if p.name != 'self'])
    return str(sig)