This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mpheath
Recipients mpheath
Date 2020-02-02.04:09:48
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1580616588.9.0.5083341091.issue39524@roundup.psfhosted.org>
In-reply-to
Content
In the ast module, a function named _pad_whitespace has a doc string with escape sequences of \f and \t.

The current doc string from Lib/ast.py:305 is:

    """Replace all chars except '\f\t' in a line with spaces."""

Example of doc string output in a REPL:

    Python 3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:37:50) [MSC v.1916 64 bit (AMD64)] on win32
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import ast
    >>> import inspect
    >>> inspect.getdoc(ast._pad_whitespace)
    "Replace all chars except '\x0c     ' in a line with spaces."
    >>>

The \x0c is the formfeed and the '     ' (5 spaces) was the tab.

It is my understanding that the output should be:

    "Replace all chars except '\f\t' in a line with spaces."

I would expect the source to be:

    """Replace all chars except '\\f\\t' in a line with spaces."""

or perhaps a raw string:

    r"""Replace all chars except '\f\t' in a line with spaces."""

The current Lib/ast.py:305 is Python 3.9.0 alpha 3 though the issue is also in Python 3.8.0 and 3.8.1 with Lib/ast.py:227 .
Python 3.7.4 Lib/ast.py does not have the function _pad_whitespace as it appears major code changes occurred in the ast module with Python 3.8.0.
History
Date User Action Args
2020-02-02 04:09:48mpheathsetrecipients: + mpheath
2020-02-02 04:09:48mpheathsetmessageid: <1580616588.9.0.5083341091.issue39524@roundup.psfhosted.org>
2020-02-02 04:09:48mpheathlinkissue39524 messages
2020-02-02 04:09:48mpheathcreate