Message154363
| Author |
larry |
| Recipients |
gvanrossum, larry, loewis, r.david.murray |
| Date |
2012年02月26日.15:56:44 |
| SpamBayes Score |
0.0028502704 |
| Marked as misclassified |
No |
| Message-id |
<1330271805.31.0.204982845794.issue14127@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
I suggest that publishing nanoseconds as a plain int would be a nasty API. Consider what it would do to os.utime:
if isinstance(mtime, int):
# must be st_mtime_ns, it's in nanoseconds, use as-is
value = mtime
else:
assert isinstance(mtime, float)
# must be st_mtime, it's in seconds, multiply by a billion
value = mtime * 1000000000
Have we ever published an API that treated a parameter as two wildly different numbers based solely on whether the parameter was an int or a float? |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2012年02月26日 15:56:45 | larry | set | recipients:
+ larry, gvanrossum, loewis, r.david.murray |
| 2012年02月26日 15:56:45 | larry | set | messageid: <1330271805.31.0.204982845794.issue14127@psf.upfronthosting.co.za> |
| 2012年02月26日 15:56:44 | larry | link | issue14127 messages |
| 2012年02月26日 15:56:44 | larry | create |
|