Message162886
| Author |
larry |
| Recipients |
larry |
| Date |
2012年06月15日.10:53:37 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1339757618.68.0.436456402492.issue15078@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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. |
|
History
|
|---|
| 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 |
|