-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
Improve docstrings and add month validation helper #143311
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
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
|
This isn't worth the churn, I'll decline. Please read the devguide when contributing to CPython. A |
picnixz
left a comment
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.
Usually, we don't want docstrings to contain the full information. This is left to the online docs. So I don't think we want this change.
|
|
||
|
|
||
| def _validate_month(month): | ||
| """ |
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 don't think this is needed. The code is small and pretty clear.
|
|
||
| def timegm(tuple): | ||
| """Unrelated but handy function to calculate Unix timestamp from GMT.""" | ||
| """ |
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 think it's fine to have a short description. The full description is in https://docs.python.org/3/library/calendar.html#calendar.timegm.
|
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 |
|
@picnixz this looks like an LLM generated PR anyway... |
Summary
This PR improves documentation clarity and internal validation logic.
Changes
_validate_month()helper to ensure month values are integers within the valid range (1–12).timegm()docstring for better accuracy and readability.Rationale
These changes improve code readability, correctness, and internal consistency without affecting external behavior.
Backwards Compatibility