bpo-40017: add CLOCK_TAI constant to the time module, if the constant is defined#19096
bpo-40017: add CLOCK_TAI constant to the time module, if the constant is defined#19096benjaminp merged 11 commits intopython:masterfrom
Conversation
|
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA). Recognized GitHub usernameWe couldn't find a bugs.python.org (b.p.o) account corresponding to the following GitHub usernames: This might be simply due to a missing "GitHub Name" entry in one's b.p.o account settings. This is necessary for legal reasons before we can look at this contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. You can check yourself to see if the CLA has been received. Thanks again for the contribution, we look forward to reviewing it! |
|
My Python tracker username is r3owen. My github username is r_owen and I already set that in the details for my bug tracker account and signed the contribution agreement. |
Misc/NEWS.d/next/Library/2020-03-21-00-46-18.bpo-40017.HFpHZS.rst
Outdated
Show resolved
Hide resolved
Doc/library/time.rst
Outdated
There was a problem hiding this comment.
It seems erroneous to say "seconds" here, since the constant merely implies a a clock not a unit. It might be helpful to have a sentence about how International Atomic Time—which should be capitalized by the way—is different from UTC. Or at least provide a link to an official page about it if there is one.
There was a problem hiding this comment.
I will add a link though I worry that the long line will be unwelcome.
Note that computer clock time is not actually UTC (my text in the issue was not fully correct), though it is closely related. This makes it difficult to explain in a few words what this does. But anyone who wants TAI will be pleased to have CLOCK_TAI.
There is also a CLOCK_UTC constant I could expose, but I do not see how it can be used to return anything useful. For proper UTC handling at a leap second it is necessary to express the date as a datetime object, ISO format, or similar; a duration since the epoch is not good enough.
Misc/NEWS.d/next/Library/2020-03-21-00-46-19.bpo-40017.HFpHZS.rst
Outdated
Show resolved
Hide resolved
|
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 made the requested changes. If the long text in time.rst is a problem I would appreciate a suggestion how to resolve it. |
|
I have made the requested changes; please review again |
|
Thanks for making the requested changes! @benjaminp: please review the changes made to this pull request. |
Doc/library/time.rst
Outdated
There was a problem hiding this comment.
I like having two empty lines, it helps readibility. Please keep it ;-)
There was a problem hiding this comment.
| Expose the CLOCK_TAI constant to the time library if the operating system support it. | |
| Add :data:`time.CLOCK_TAI` constant, if the operating system support it: International Atomic Time. |
There was a problem hiding this comment.
You and @benjaminp seem to have different ideas for this entry. I've gone with @vstinner's version for now, but @benjaminp if you want something else perhaps the two of you can agree?
|
I have made the requested changes; please review again. |
|
Thanks for making the requested changes! @benjaminp: please review the changes made to this pull request. |
vstinner
left a comment
There was a problem hiding this comment.
LGTM. I let @benjaminp merge it :-)
8b7d6c7 to
903741c
Compare
903741c to
22db5e6
Compare
Added the CLOCK_TAI constant to the time module, if present (and checked that it worked on ubuntu).
Added a description to the time module documentation.
I will gladly add a unit test if somebody can point me to the existing tests for these constants (a global search for CLOCK_BOOTTIME didn't turn up anything.
Would it make any sense to add this to the next Python 8.x as well?
https://bugs.python.org/issue40017