Skip to content

Conversation

mehdihassan93
Copy link
Contributor

@mehdihassan93 mehdihassan93 commented Sep 5, 2025

Addresses issue #97517 by adding links to format codes documentation for all strftime and strptime methods in the datetime module.

Changes Made

  • Added documentation links to all strftime methods in date, time, and datetime classes
  • Added documentation links to all strptime methods in date, time, and datetime classes
  • Used the plain text link format as suggested by @StanFromIreland in previous PR feedback

Format Used

For a list of supported format codes, see the documentation:
https://docs.python.org/3/library/datetime.html#format-codes

Question

I've updated all the Python docstrings as suggested in the previous PR #132375. Should I also update the C extension docstrings mentioned in that feedback, or is this sufficient to start with?

Closes #97517

- Add links to format codes documentation for all strftime methods
- Add links to format codes documentation for all strptime methods
- Addresses issue python#97517
@python-cla-bot
Copy link

python-cla-bot bot commented Sep 5, 2025

All commit authors signed the Contributor License Agreement.

CLA signed

@bedevere-app

This comment was marked as resolved.

@StanFromIreland StanFromIreland changed the title Fix #97517: Add documentation links to datetime strftime/strptime docstrings Fix gh-97517: Add documentation links to datetime strftime/strptime docstrings Sep 5, 2025
@StanFromIreland StanFromIreland changed the title Fix gh-97517: Add documentation links to datetime strftime/strptime docstrings gh-97517: Add documentation links to datetime strftime/strptime docstrings Sep 5, 2025
Copy link
Member

@StanFromIreland StanFromIreland left a comment

Choose a reason for hiding this comment

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

Please sign the CLA and update the C docstrings.

@mehdihassan93
Copy link
Contributor Author

Got it, working on the CLA now and will update the C docstrings. Thanks!

@StanFromIreland
Copy link
Member

You need to run make clinic

@StanFromIreland
Copy link
Member

Please do not use the Update Branch button unless necessary (e.g. fixing conflicts, jogging the CI, or very old PRs) as it uses valuable resources. For more information see the devguide.

To resolve the CI failure, see my above comment.

Copy link
Member

@StanFromIreland StanFromIreland left a comment

Choose a reason for hiding this comment

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

Please have consistent spacing, some docstrings have a line, some don't.

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Copy link
Member

@pganssle pganssle left a comment

Choose a reason for hiding this comment

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

Not too many places in the standard library that have a link in a docstring like this, but I did find a few examples, and this does seem like a good idea, so let's go for it.

@StanFromIreland
Copy link
Member

@pganssle FYI It is your email that is causing the CI to fail, you have not signed the CLA with the GitHub address.

@pganssle pganssle merged commit dfd52e7 into python:main Sep 15, 2025
43 checks passed
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.

Docstrings for some methods in the datetime module are not very clear or helpful

3 participants