def info(fname, expected, actual, flag):
    """ Convenience function returns nicely formatted error/warning msg. """
    #typesはtype関数の結果のタプル
    #<type 'float'> -> '<type ', 'float', '>'の1番目
    format = lambda types: ', '.join([str(t).split("'")[1] for t in types])
    expected, actual = format(expected), format(actual)
    msg = "'%s' method " % fname \
          + ("accepts", "returns")[flag] + " (%s), but " % expected\
          + ("was given", "result is")[flag] + " (%s)" % actual
    return msg