Skip to content

Conversation

@Mohitainm
Copy link

Summary

This PR improves documentation clarity and internal validation logic.

Changes

  • Expanded and clarified docstrings for existing functions.
  • Added _validate_month() helper to ensure month values are integers within the valid range (1–12).
  • Updated the timegm() docstring for better accuracy and readability.
  • No functional behavior changes to public APIs.

Rationale

These changes improve code readability, correctness, and internal consistency without affecting external behavior.

Backwards Compatibility

  • No breaking changes.

@Mohitainm Mohitainm requested a review from AA-Turner as a code owner December 31, 2025 17:43
@python-cla-bot
Copy link

python-cla-bot bot commented Dec 31, 2025

All commit authors signed the Contributor License Agreement.

CLA signed

@bedevere-app
Copy link

bedevere-app bot commented Dec 31, 2025

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 skip news label instead.

@AA-Turner
Copy link
Member

This isn't worth the churn, I'll decline. Please read the devguide when contributing to CPython.

A

@AA-Turner AA-Turner closed this Dec 31, 2025
Copy link
Member

@picnixz picnixz left a 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):
"""
Copy link
Member

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

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.

@bedevere-app
Copy link

bedevere-app bot commented Dec 31, 2025

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.

@AA-Turner
Copy link
Member

@picnixz this looks like an LLM generated PR anyway...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants