def remove_hop_by_hop_headers ( headers ) : headers [ : ] = [ ( key , value ) for key , value in headers if not is_hop_by_hop_header ( key ) ]
python function to remove headers
Remove all HTTP / 1 . 1 Hop - by - Hop headers from a list or : class : Headers object . This operation works in - place .
def remove_hop_by_hop_headers(headers):
    """Remove all HTTP/1.1 "Hop-by-Hop" headers from a list or
    :class:`Headers` object.  This operation works in-place.

    .. versionadded:: 0.5

    :param headers: a list or :class:`Headers` object.
    """
    headers[:] = [
        (key, value) for key, value in headers if not is_hop_by_hop_header(key)
    ]