<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 14 October 2017 at 18:21, Antoine Pitrou <span dir="ltr"><<a href="mailto:solipsis@pitrou.net" target="_blank">solipsis@pitrou.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Sat, 14 Oct 2017 10:49:11 +0300<br>
Serhiy Storchaka <<a href="mailto:storchaka@gmail.com">storchaka@gmail.com</a>><br>
wrote:<br>
<div><div class="gmail-h5">> I don't like the idea of adding a parallel set of functions.<br>
><br>
> In the list of alternatives in PEP 410 there is no an idea about fixed<br>
> precision float type with nanoseconds precision. It can be implemented<br>
> internally as a 64-bit integer, but provide all methods required for<br>
> float-compatible number. It would be simpler and faster than general<br>
> Decimal.<br>
<br>
</div></div>I agree a parallel set of functions is not ideal, but I think a parallel<br>
set of functions is still more appropriate than a new number type<br>
specific to the time module.<br>
<br>
Also, if you change existing functions to return a new type, you risk<br>
breaking compatibility even if you are very careful about designing the<br>
new type.<br></blockquote><div><br></div>Might it make more sense to have a parallel *module* that works with a different base data type rather than parallel functions within the existing API?</div><div class="gmail_quote"><br></div><div class="gmail_quote">That is, if folks wanted to switch to 64-bit nanosecond time, they would use:</div><div class="gmail_quote"><br></div><div class="gmail_quote">* time_ns.time()<br>
* time_ns.monotonic()<br>
* time_ns.perf_counter()<br>
* time_ns.clock_gettime()<br>
* time_ns.clock_settime()</div><div class="gmail_quote"><br></div><div class="gmail_quote">The idea here would be akin to the fact we have both math and cmath as modules, where the common APIs conceptually implement the same algorithms, they just work with a different numeric type (floats vs complex numbers).</div><br><div class="gmail_quote">Cheers,</div><div class="gmail_quote">Nick.<br></div><br>-- <br><div class="gmail_signature">Nick Coghlan   |   <a href="mailto:ncoghlan@gmail.com" target="_blank">ncoghlan@gmail.com</a>   |   Brisbane, Australia</div>
</div></div>