[Python-Dev] [RFC] PEP 418: Add monotonic time, performance counter and process time functions
Guido van Rossum
guido at python.org
Sun Apr 29 16:49:25 CEST 2012
On Sat, Apr 28, 2012 at 1:32 PM, Victor Stinner
<victor.stinner at gmail.com> wrote:
>>> As a thin wrapper, adding it to the time module was pretty much
>>> uncontroversial, I think. The PEP proposes cross-platform
>>> functions with consistent semantics, which is where a discussion was
>> True, but does this mean clock_gettime and friends only exist on
>> POSIX? Shouldn't they be in the os or posix module then? I guess I'm
>> fine with either place but I don't know if enough thought was put into
>> the decision. Up until now the time module had only cross-platform
>> functions (even if clock()'s semantics vary widely).
> The os module is big enough. Low level networks functions are not in
> the os module, but in the socket module.
There are subtle other reasons for that (such as that on Windows,
socket file descriptors and os file descriptors are different things).
But I'm fine with leaving these in the time module.
> Not all functions of the time module are always available. For
> example, time.tzset() is not available on all platforms. Another
> example, the new time.monotonic() is not available on all platforms
> Oh, I forgot to mention that time.clock_*() functions are not always
> available in the doc.
Yeah, I think the docs can use some work Maybe from someone interested
in contributing to docs specifically? I don't want to make Victor
responsible for everything. But the new docs for the time module are a
but confusing due to the explosion of new functions and constants.
E.g. several descriptions use 'clk_id' without explaining it. Maybe a
separate subsection can be created for low-level and/or
platform-specific items, leaving the main time module to explain the
traditional functions and the new portable functions from PEP 418?
--Guido van Rossum (python.org/~guido)
More information about the Python-Dev