Message162886
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, rather than adding and removing parameters based on what functionality is available.
os.sendfile() accepts either four or seven parameters, depending on the current platform. However, it's a new function in trunk and therefore has no installed base. So it's not too late to change it.
I propose to amend os.sendfile so it always accepts all seven arguments. Its signature would therefore be the following, on all platforms:
os.sendfile(out, in, offset, nbytes, headers=None, trailers=None, flags=0)
Passing in a non-None value for headers or trailers, or a nonzero value for flags, on a platform where the seven-argument form of sendfile is not available would raise NotImplementedError. |
|
Date |
User |
Action |
Args |
2012-06-15 10:53:38 | larry | set | recipients:
+ larry |
2012-06-15 10:53:38 | larry | set | messageid: <1339757618.68.0.436456402492.issue15078@psf.upfronthosting.co.za> |
2012-06-15 10:53:38 | larry | link | issue15078 messages |
2012-06-15 10:53:37 | larry | create | |
|