[Python-Dev] time.clock_info() field names (original) (raw)
Victor Stinner victor.stinner at gmail.com
Tue Jun 12 23:03:40 CEST 2012
- Previous message: [Python-Dev] Using pdb with greenlet
- Next message: [Python-Dev] dictnotes.txt out of date?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
2012/5/4 Victor Stinner <victor.stinner at gmail.com>:
Anyway, the implementation and/or the documentation is buggy and should be fixed (especially the Windows case).
Done, I renamed "adjusted" to "adjustable", fixed its value on Windows (time.time) and Linux (time.monotonic), and updated the doc.
changeset: 77415:0e46e0cd368f tag: tip user: Victor Stinner <victor.stinner at gmail.com> date: Tue Jun 12 22:46:37 2012 +0200 files: Doc/library/time.rst Include/pytime.h Lib/test/test_time.py Misc/NEWS Modules/timemodule.c Python/pytime.c description: PEP 418: Rename adjusted attribute to adjustable in time.get_clock_info() result
Fix also its value on Windows and Linux according to its documentation: "adjustable" indicates if the clock can be adjusted, not if it is or was adjusted.
In most cases, it is not possible to indicate if a clock is or was adjusted.
Basically, time.get_clock_info().adjustable is only True for time.time(). It can also be True for time.perf_counter() if time.monotonic() is not available.
I prefer "adjustable" over "adjusted" because it is well defined and its value is well known. For example, it is not easy to say if time.monotonic() is "adjusted" or not on Linux, whereas I can say that time.monotonic() is not adjustable on any OS.
I will update the PEP except if someone complains :-)
Sorry for being late, but I was exhausted by this PEP.
Victor
- Previous message: [Python-Dev] Using pdb with greenlet
- Next message: [Python-Dev] dictnotes.txt out of date?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]