

def push_stream(self, stream_id, promised_stream_id, request_headers):
    '\n        Push a response to the client by sending a PUSH_PROMISE frame.\n\n        If it is important to send HPACK "never indexed" header fields (as\n        defined in `RFC 7451 Section 7.1.3\n        <https://tools.ietf.org/html/rfc7541#section-7.1.3>`_), the user may\n        instead provide headers using the HPACK library\'s :class:`HeaderTuple\n        <hpack:hpack.HeaderTuple>` and :class:`NeverIndexedHeaderTuple\n        <hpack:hpack.NeverIndexedHeaderTuple>` objects.\n\n        :param stream_id: The ID of the stream that this push is a response to.\n        :type stream_id: ``int``\n        :param promised_stream_id: The ID of the stream that the pushed\n            response will be sent on.\n        :type promised_stream_id: ``int``\n        :param request_headers: The headers of the request that the pushed\n            response will be responding to.\n        :type request_headers: An iterable of two tuples of bytestrings or\n            :class:`HeaderTuple <hpack:hpack.HeaderTuple>` objects.\n        :returns: Nothing\n        '
    if (not self.remote_settings.enable_push):
        raise ProtocolError('Remote peer has disabled stream push')
    self.state_machine.process_input(ConnectionInputs.SEND_PUSH_PROMISE)
    stream = self._get_stream_by_id(stream_id)
    if ((stream_id % 2) == 0):
        raise ProtocolError('Cannot recursively push streams.')
    new_stream = self._begin_new_stream(promised_stream_id, AllowedStreamIDs.EVEN)
    stream.streams[promised_stream_id] = new_stream
    frames = stream.push_stream_in_band(promised_stream_id, request_headers, self.encoder)
    new_frames = new_stream.locally_pushed()
    self._prepare_for_sending((frames + new_frames))

dataset/ETHPy150Open python-hyper/hyper-h2/h2/connection.py H2Connection.push_stream/VarMisuse@90/546 `self`->`stream`