def format_as(format_string):
    """format_as(form)(obj) = form % obj

    Useful to format many objects with the same format string.

    >>> list(map(format_as("0x%x"), [0, 1, 10, 11, 15]))
    ['0x0', '0x1', '0xa', '0xb', '0xf']
    """
    return lambda obj : format_string % obj