[issue15078] Change os.sendfile so its arguments are stable

2012-06-23 Thread Larry Hastings
Larry Hastings added the comment: It is usually folly to disagree with MvL, and yet I am about to do just that. As stated, I don't believe in the "thin wrappers" theory of os; where would a Windows programmer find the man page to learn how os.access works on their system? I think os should

[issue15078] Change os.sendfile so its arguments are stable

2012-06-23 Thread Charles-François Natali
Charles-François Natali added the comment: > What's wrong with mmap? It uses list of optional arguments (`flags`, > `prot`, `access`) and not only one `flags` argument. Of course it does, as the mmap syscall(), since this arguments have nothing to do with one another. I was refering to your pr

[issue15078] Change os.sendfile so its arguments are stable

2012-06-23 Thread Martin v . Löwis
Martin v. Löwis 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

[issue15078] Change os.sendfile so its arguments are stable

2012-06-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > I personally like the change, except for `flags` argument collapsing. Imagine > what mmap's prototype would look like if we used list of optional arguments > instead of a flag... What's wrong with mmap? It uses list of optional arguments (`flags`, `prot`,

[issue15078] Change os.sendfile so its arguments are stable

2012-06-23 Thread Charles-François Natali
Changes by Charles-François Natali : -- nosy: +loewis ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://ma

[issue15078] Change os.sendfile so its arguments are stable

2012-06-23 Thread Charles-François Natali
Charles-François Natali added the comment: > But at the heart of the matter, I see no benefit to exposing Python > developers to the idiosyncrasies of poor C API design. I feel strongly that > one way Python becomes "pythonic" is that it aims for the convenience of the > programmer--not the lan

[issue15078] Change os.sendfile so its arguments are stable

2012-06-16 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: I'm -0 about unifying the function signature and raise NotImplementedError where an arg is not supported. I'm -1 about os.sendfile(..., diskio=True, wait=True, sync=False). In both cases users willing to use these 3 args are already supposed to know what

[issue15078] Change os.sendfile so its arguments are stable

2012-06-15 Thread Larry Hastings
Larry Hastings added the comment: > There are some other functions with strange/variable prototype: > http://docs.python.org/dev/library/fcntl.html?highlight=ioctl#fcntl.ioctl > http://docs.python.org/dev/library/mmap.html?highlight=mmap.mmap#mmap.mmap It does not follow that this behavior is d

[issue15078] Change os.sendfile so its arguments are stable

2012-06-15 Thread STINNER Victor
STINNER Victor added the comment: > As I keep saying on python-dev: I think that the argument list for a function > should be stable. There are some other functions with strange/variable prototype: http://docs.python.org/dev/library/fcntl.html?highlight=ioctl#fcntl.ioctl http://docs.python.org

[issue15078] Change os.sendfile so its arguments are stable

2012-06-15 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue15078] Change os.sendfile so its arguments are stable

2012-06-15 Thread Larry Hastings
Larry Hastings added the comment: > os.sendfile(out, in, offset, nbytes, *, headers=None, trailers=None, > diskio=True, wait=True, sync=False) I probably prefer this. If the original implementers are okay with it then I'd be happy to do it that way. But at the very least I want to get rid o

[issue15078] Change os.sendfile so its arguments are stable

2012-06-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I believe, that instead of a integer flags will be better and more portable to use boolean parameters (diskio=True, wait=True, sync=False). All additional parameters should be keyword-only. os.sendfile(out, in, offset, nbytes, *, headers=None, trailers=None

[issue15078] Change os.sendfile so its arguments are stable

2012-06-15 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: +giampaolo.rodola, neologix ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue15078] Change os.sendfile so its arguments are stable

2012-06-15 Thread Larry Hastings
New submission from Larry Hastings : As I keep saying on python-dev: I think that the argument list for a function should be stable. If you have a function where some abilities are only available on certain platforms, it's best to always accept default no-op parameters for those parameters, r