On Tue, Oct 19, 2021 at 9:00 AM Cameron Simpson <[email protected]> wrote: > The problem with a "download()" method is that it is almost never what > you need. There are too many ways to want to do it, and one almost > _never_ wants to suck the download itself into memory as you do above > with read() because downloads are often large, sometimes very large. > > You also don't always want to put it into a file. >
OTOH, if you *do* want to put it into a file, it should be possible to take advantage of zero-copy APIs to reduce unnecessary transfers. I'm not sure if there's a way to do that with requests. Ideally, what you want is os.sendfile() but it'd need to be cleanly wrapped by the library itself. ChrisA _______________________________________________ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/[email protected]/message/6WE4K62RS7LP3DHRGMHXN74PXM2IQ77L/ Code of Conduct: http://python.org/psf/codeofconduct/
