Skip to content
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

The docstring of enum.Enum is invalid in reStructuredText since 3.11 #92120

Closed
tk0miya opened this issue May 1, 2022 · 0 comments · Fixed by #92122
Closed

The docstring of enum.Enum is invalid in reStructuredText since 3.11 #92120

tk0miya opened this issue May 1, 2022 · 0 comments · Fixed by #92122
Assignees
Labels
3.11 stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@tk0miya
Copy link
Contributor

tk0miya commented May 1, 2022

Bug report

The docstring of enum.Enum is invalid in reStructuredText since 3.11.

$ python3.11                                                                                                ~/work/tmp/doc
Python 3.11.0a7+ (heads/main:ad5e852, May  2 2022, 01:40:38) [Clang 11.0.3 (clang-1103.0.32.62)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import enum
>>> print(enum.Enum.__doc__)
(snip)
    - attribute access::

    >>> Color.RED
    <Color.RED: 1>
(snip)
>>>

The "attribute access" line ends with a code-block marker "::". But no code-block follows.

As a result, Sphinx emits a warning for the subclasses of Enum as following:

/Users/tkomiya/work/tmp/doc/example.py:docstring of example.Transpose:7: WARNING: Literal block expected; none found.

refs: sphinx-doc/sphinx#10410

Additionally, the bullet list is interrupted by code-blocks. IMO, these code-blocks should be indented to the item level of the bullet list.

Your environment

  • CPython versions tested on: Python 3.11.0a7+ (heads/main:ad5e852, May 2 2022, 01:40:38)
  • Operating system and architecture: macOS 10.15

Linked PRs

@tk0miya tk0miya added the type-bug An unexpected behavior, bug, or error label May 1, 2022
@tk0miya tk0miya changed the title The docstring of enum.Enum is invalid in reStructuredText The docstring of enum.Enum is invalid in reStructuredText since 3.11 May 1, 2022
@AlexWaygood AlexWaygood added stdlib Python modules in the Lib dir 3.11 labels May 1, 2022
tk0miya added a commit to tk0miya/cpython that referenced this issue May 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.11 stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants