def write(self, data):
        """Reliably write some data.

        The data is buffered until his file descriptor is ready for writing.
        """
        if isinstance(data, unicode): # no, really, I mean it
            raise TypeError("Data must not be unicode")
        if not self.connected or self._writeDisconnected:
            return
        if data:
            self._tempDataBuffer.append(data)
            self._tempDataLen += len(data)
            if self.producer is not None and self.streamingProducer:
                if (len(self.dataBuffer) + self._tempDataLen
                    > self.writeBufferSize):
                    self.producerPaused = True
                    self.producer.pauseProducing()
            self.startWriting()
Reliably write some data.

        The data is buffered until his file descriptor is ready for writing.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/internet/iocpreactor/abstract.py