Skip to content
Myr

optimize str bytes concatenation

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Yun Xu · committed by Yun Xu · parent 84b9691 · Browse files · 1 file+2 added−8 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−8 removed

  • other:+2 added−8 removed

1 file+2 added−8 removed

modified:httpcore/models.py+2 added-8 removed
480 unmodified lines
481 """482 Read and return the response content.483 """484 if not hasattr(self, "content"):485 content = b""486 async for part in self.stream():487 content += part488 self.content = content485 self.content = b"".join([part async for part in self.stream()])486 return self.content487488 async def stream(self) -> typing.AsyncIterator[bytes]:489 if self.is_streaming:
176 unmodified lines
666 """667 Read and return the response content.668 """669 if not hasattr(self, "_content"):673 content = b""674 async for part in self.stream():675 content += part676 self._content = content670 self._content = b"".join([part async for part in self.stream()])671 return self._content672673 async def stream(self) -> typing.AsyncIterator[bytes]:674 """
73 unmodified lines