def format_range(value):

    # PERF(kgriffs): % was found to be faster than str.format(),
    # string concatenation, and str.join() in this case.

    if len(value) == 4:
        return '%s %s-%s/%s' % (value[3], value[0], value[1], value[2])

    return 'bytes %s-%s/%s' % (value[0], value[1], value[2])
Formats a range header tuple per the HTTP spec.
dataset/ETHPy150Open falconry/falcon/falcon/response_helpers.py/format_range