def _id2addr(matchobj):
    """
    Regexp substituion function to reformat pprint recursion text.
    """
    ret = "<Recursive reference to {type} object at 0x{addr:0x}>". \
        format(type=matchobj.group(1), addr=int(matchobj.group(2)))
    return ret