Martin v. Löwis <mar...@v.loewis.de> added the comment:

I indeed think that the code is fine as it stands, and no change is needed, and 
that the proposed changes make matters worse.

The point of the thin wrappers approach is that you can read the manpage of 
your system, and immediately can trust that this is what the Python function 
will do. It is unfortunate that BSD and Linux have chosen to give the function 
the same name despite the signature differences, but there is no value in 
hiding this fact from the Python user.

The whole point of this function is performance and zero copy. Anybody using it 
will need to understand well what they are doing, and that their code is highly 
system-dependent. If you want cross-platform code, use shutil.copyfileobj.

I could agree to a higher-level function that tries to avoid system 
differences, but that function shouldn't be called sendfile. For example, the 
socket object could have a sendfd or sendstream method which would use the 
proper variant of sendfile if available, else uses a regular read/send loop.

I always found the name "sendfile" confusing, anyway, since it's not the file 
that is being sent, but the all (or some) of the contents of the file.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue15078>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to