Skip to content

datetime.isoformat() docstring has a typo #135956

Closed

Description

@jason-mcgowan

Documentation

In 3.13 cpython/Lib/_pydatetime.py line 2046-2047, linked below, the docstring has a typo. It repeats the word "giving".

cpython/Lib/_pydatetime.py

Lines 2046 to 2047 in c148a68

If self.tzinfo is not None, the UTC offset is also attached, giving
giving a full format of 'YYYY-MM-DD HH:MM:SS.mmmmmm+HH:MM'.

Linked PRs

Activity

  1. terryjreedy commented on Jun 25, 2025

    @terryjreedy
    Member

    Still in main. Preparing PR.

  2. added 2 commits that reference this issue on Jun 25, 2025
  3. brianschubert commented on Jun 25, 2025

    @brianschubert
    Contributor

    A quick regex search for \b(\w+)\b *\n *\1\b shows that this is the only such case in Lib/ public docstrings

  4. added a commit that references this issue on Jun 26, 2025
  5. added 2 commits that reference this issue on Jun 26, 2025
  6. added 2 commits that reference this issue on Jun 26, 2025
  7. terryjreedy commented on Jun 26, 2025

    @terryjreedy
    Member

    @jason-mcgowan Thanks for catching this. @brianschubert Thanks for checking for more. Others have done this before, so I am surprised that this one got missed. Maybe just an oversight in the last round.

  8. StanFromIreland commented on Jun 26, 2025

    @StanFromIreland
    Member

    Other occurrences, limited to triple quoted docstrings, omitting tests, as I was getting too much noise otherwise:

    Private:

    ./Lib/asyncio/base_events.py:"""Prepare the run loop to process events.
    
            This method exists so that custom custom event loop subclasses (e.g., event loops
            that integrate a GUI event loop with Python's event loop) have access to all the
            loop setup logic.
            """.
    ./Lib/asyncio/base_events.py:"""Clean up after an event loop finishes the looping over events.
    
            This method exists so that custom custom event loop subclasses (e.g., event loops
            that integrate a GUI event loop with Python's event loop) have access to all the
            loop cleanup logic.
            """
    ./Lib/idlelib/editor.py:"""Return 2 lines containing block opener and and indent.
    
            Either the indent line or both may be None.
            """

    Public:

    ./Lib/unittest/mock.py:"""assert that the mock was called exactly once and that that call was
            with the specified arguments."""
  9. LamentXU123 commented on Jun 26, 2025

    @LamentXU123
    Contributor

    Other occurrences, limited to triple quoted docstrings, omitting tests, as I was getting too much noise otherwise:

    Private:

    ./Lib/asyncio/base_events.py:"""Prepare the run loop to process events.
    
            This method exists so that custom custom event loop subclasses (e.g., event loops
            that integrate a GUI event loop with Python's event loop) have access to all the
            loop setup logic.
            """.
    ./Lib/asyncio/base_events.py:"""Clean up after an event loop finishes the looping over events.
    
            This method exists so that custom custom event loop subclasses (e.g., event loops
            that integrate a GUI event loop with Python's event loop) have access to all the
            loop cleanup logic.
            """
    ./Lib/idlelib/editor.py:"""Return 2 lines containing block opener and and indent.
    
            Either the indent line or both may be None.
            """

    Public:

    ./Lib/unittest/mock.py:"""assert that the mock was called exactly once and that that call was
            with the specified arguments."""

    Great! May I include this in #135964?

  10. LamentXU123 commented on Jun 28, 2025

    @LamentXU123
    Contributor

    Hi, @StanFromIreland friendly pinging here. These typos you've mentioned are still in the main branch, would you like me to open a PR to fix it?

  11. StanFromIreland commented on Jun 28, 2025

    @StanFromIreland
    Member

    You can fix the public one if you wish, though it's not high priority, I'm 0 on the others.

  12. LamentXU123 commented on Jun 28, 2025

    @LamentXU123
    Contributor

    You can fix the public one if you wish, though it's not high priority, I'm 0 on the others.

    Sure! #136067

  13. added a commit that references this issue on Jul 11, 2025
  14. added a commit that references this issue on Jul 12, 2025
  15. added a commit that references this issue on Aug 4, 2025
  16. added a commit that references this issue on Aug 19, 2025
  17. added a commit that references this issue on May 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc dir

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions