Skip to content

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

Merged
merged 11 commits into from
Jan 10, 2019

Conversation

nanjekyejoannah
Copy link
Contributor

@nanjekyejoannah nanjekyejoannah commented Jan 10, 2019

I have added a clock constant, CLOCK_UPTIME_RAW for Darwin.

https://bugs.python.org/issue35702

Copy link
Member

@vstinner vstinner left a 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:

https://docs.python.org/dev/whatsnew/3.7.html#time


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.
Copy link
Member

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.

Copy link
Contributor Author

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?

Copy link
Member

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.

point, unaffected by frequency or time adjustments and not increment while
the system is asleep.

.. availability:: Unix.
Copy link
Member

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:

Suggested change
.. availability:: Unix.
.. availability:: macOS 10.12 and newer.


.. availability:: Unix.

.. versionadded:: 3.7
Copy link
Member

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.

Suggested change
.. versionadded:: 3.7
.. versionadded:: 3.8

@bedevere-bot
Copy link

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 I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

Copy link
Member

@vstinner vstinner left a 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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The CLOCK_UPTIME_RAW constant is now available for Darwin.
The :data:`time.CLOCK_UPTIME_RAW` constant is now available for macOS 10.12.

.. 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
Copy link
Member

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"?

time
-------

Added a new clock identifier `~time.CLOCK_UPTIME_RAW` for Darwin that increments
Copy link
Member

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).

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.
Copy link
Member

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.

Copy link
Member

@vstinner vstinner left a 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.

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`.)
Copy link
Member

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 :-)

Copy link
Contributor Author

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.

Copy link
Member

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 :-)

Copy link
Member

@vstinner vstinner left a 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 ;-)

@vstinner
Copy link
Member

Thanks @nanjekyejoannah, I merged your PR.

@nanjekyejoannah nanjekyejoannah deleted the add_clock_constants branch January 11, 2019 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants