-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
bpo-35702: Add new identifier CLOCK_UPTIME_RAW for Darwin #11503
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you mind to mention the new constant in Doc/whatsnew/3.8.rst? Follow this example:
|
||
Clock that increments monotonically, tracking the time since an arbitrary | ||
point, unaffected by frequency or time adjustments and not increment while | ||
the system is asleep. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. FYI http://www.manpagez.com/man/3/clock_gettime/ has a different definition:
CLOCK_UPTIME_RAW clock that increments monotonically, in the same man-
ner as CLOCK_MONOTONIC_RAW, but that does not incre-
ment while the system is asleep. The returned value
is identical to the result of mach_absolute_time()
after the appropriate mach_timebase conversion is
applied.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmmm... is the current short version better or we use the description in the man page?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The short version is fine. The longer version doesn't add anything useful and is too low-level.
Doc/library/time.rst
Outdated
point, unaffected by frequency or time adjustments and not increment while | ||
the system is asleep. | ||
|
||
.. availability:: Unix. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unix is vague. I suggest to be more precise:
.. availability:: Unix. | |
.. availability:: macOS 10.12 and newer. |
Doc/library/time.rst
Outdated
|
||
.. availability:: Unix. | ||
|
||
.. versionadded:: 3.7 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer to only add the constant to the master branch which is the future Python 3.8.
.. versionadded:: 3.7 | |
.. versionadded:: 3.8 |
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah good, your PR now looks better. Can please also mention the change in the What's New in Python 3.8? (see my previous comment)
@@ -0,0 +1 @@ | |||
The CLOCK_UPTIME_RAW constant is now available for Darwin. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CLOCK_UPTIME_RAW constant is now available for Darwin. | |
The :data:`time.CLOCK_UPTIME_RAW` constant is now available for macOS 10.12. |
Doc/library/time.rst
Outdated
.. data:: CLOCK_UPTIME_RAW | ||
|
||
Clock that increments monotonically, tracking the time since an arbitrary | ||
point, unaffected by frequency or time adjustments and not increment while |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(English is not my first language.) English question: is "not increment while..." correct? Or should it be "not incremented" as in "unaffected"?
Doc/whatsnew/3.8.rst
Outdated
time | ||
------- | ||
|
||
Added a new clock identifier `~time.CLOCK_UPTIME_RAW` for Darwin that increments |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Darwin is correct, but I prefer "macOS" since this name is more commonly used than Darwin (in my experience).
Doc/whatsnew/3.8.rst
Outdated
Added new clock :data:`~time.CLOCK_UPTIME_RAW` for macOS 10.12 that | ||
increments monotonically, tracking the time since an arbitrary point, | ||
unaffected by frequency or time adjustments and not incremented while the | ||
system is asleep. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer just "Added new clock :data:~time.CLOCK_UPTIME_RAW
for macOS 10.12." Since the doc generates a link to the doc, there is no need to repeat the constant documentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost good! Just a few final comments.
Doc/whatsnew/3.8.rst
Outdated
increments monotonically, tracking the time since an arbitrary point, | ||
unaffected by frequency or time adjustments and not incremented while the | ||
system is asleep. | ||
(Contributed by Ricardo Fraile in :issue:`35702`.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be your name here :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ohh..I thought the issue author. Noted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem. Sometimes it's the same person :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks ;-)
Note: I'm mentoring @nanjekyejoannah and I'm fine with her doing small commits, since all commits are squashed into a single commit on merge ;-)
Thanks @nanjekyejoannah, I merged your PR. |
I have added a clock constant, CLOCK_UPTIME_RAW for Darwin.
https://bugs.python.org/issue35702