erickguan commented on code in PR #6086:
URL: https://github.com/apache/opendal/pull/6086#discussion_r2094533732


##########
bindings/python/python/opendal/__init__.pyi:
##########
@@ -472,6 +475,20 @@ class AsyncFile:
         Args:
             bs (bytes): The content to write.
         """
+    async def write_from(self, other: AsyncFile) -> None:

Review Comment:
   `Operator` works with `shutil.copyfileobj` but not `AsyncOperator`. Perhaps 
something like this as a utility function:
   
   ```python
   async def async_copyfileobj(reader, writer, bufsize: int = 64 * 1024):
       while True:
           chunk = await reader.read(bufsize)
           if not chunk:
               break
           await writer.write(chunk)
   ```
   
   It would be great if python offers an async version of `shutil`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@opendal.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to