Skip to content

gh-137742: Use footnote markup for table notes in datetime docs #137743

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

brianschubert
Copy link
Member

@brianschubert brianschubert commented Aug 13, 2025

When used with the :meth:`~.datetime.strptime` method, the leading zero is optional
for formats ``%d``, ``%m``, ``%H``, ``%I``, ``%M``, ``%S``, ``%j``, ``%U``,
``%W``, and ``%V``. Format ``%y`` does require a leading zero.
(10)
.. [#fa]
Copy link
Member Author

Choose a reason for hiding this comment

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

This note didn't have any references (which made sphinx complain), so I added a one to the day-of-month entry in the table. For reference, this was added in #117107

@@ -653,46 +653,46 @@ Supported operations:
| Operation | Result |
+===============================+==============================================+
| ``date2 = date1 + timedelta`` | ``date2`` will be ``timedelta.days`` days |
| | after ``date1``. (1) |
| | after ``date1``. [#date1]_ |
Copy link
Member

@terryjreedy terryjreedy Aug 14, 2025

Choose a reason for hiding this comment

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

A possible negative is that footnotes are numbered sequentially throughout the whole file instead of restarting with 1 (because of the explicit number labels starting with 1). This, for instance, becomes file footnote 7 rather that table note 1.

date2 = date1 + timedelta | date2 will be timedelta.days days after date1. [7]

in the preview. On the other hand, The links to notes and backlinks from note to table line are nice, especially when multiple, as in

[1] (1,2,3,4) This is exact but may overflow.

where 1,2,3,4 link to the 4 items with this property. This is not such a big deal on my 4K monitor, but I imagine would be very helpful with phones, and I know there are coredevs and I presume other users that use phones. Overall, I think the change is positive.

@StanFromIreland
Copy link
Member

StanFromIreland commented Aug 14, 2025

While this is quite nice, I also think it has the major downside of breaking many references to the documentation. Users who see a notice, for example in an issue comment (which I have made before), will be confused as suddenly "See Note 5" directs users to some note about timedeltas and not %f.

This would have less of an impact if this was not backported IMO.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting review docs Documentation in the Doc dir needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes skip news
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

3 participants