[Python-ideas] millisecond and microsecond times without floats

Joao S. O. Bueno jsbueno at python.org.br
Tue Jun 23 18:55:09 CEST 2015


For new functions altogether, maybe namespaces could be the a nice option --

from time.milliseconds import sleep, monotonic

Named parameters would be a better way to implement it,though - I just
don't know if having to go through the function
that does have to be ready to handle floats anyway won't be in the way
of the desired optimization



On 22 June 2015 at 21:39, Gregory P. Smith <greg at krypto.org> wrote:
>
>
> On Mon, Jun 22, 2015 at 5:35 PM Alexander Belopolsky
> <alexander.belopolsky at gmail.com> wrote:
>>
>>
>> On Mon, Jun 22, 2015 at 8:03 PM, Gregory P. Smith <greg at krypto.org> wrote:
>>>
>>> # We could use the long form names milliseconds, microseconds and
>>> nanoseconds but i worry with those that people would inevitably confuse ms
>>> with microseconds as times and APIs usually given the standard abbreviations
>>> rather than spelled out.
>>
>>
>> Note that datetime.timedelta uses long names:
>>
>> >>> timedelta(milliseconds=5, microseconds=3)
>> datetime.timedelta(0, 0, 5003)
>
>
> That is a good vote for consistency with its API...
>
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/


More information about the Python-ideas mailing list