-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Use better types for time.get_clock_info
#7040
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
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
stdlib/time.pyi
Outdated
monotonic: bool | ||
resolution: float | ||
|
||
def get_clock_info(name: Literal["monotonic", "perf_counter", "process_time", "time"]) -> _ClockInfo: ... |
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.
CPython tests also call this with "thread_time"
. Looking at the C source code, that's the only missing name.
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.
Looks like it is also missing from the tests in some places 🤔
I will investigate! Thank you!
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.
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
Demo:
Docs: https://docs.python.org/3/library/time.html#time.get_clock_info