Skip to content

Preserve docstrings in the new parser - #21890

Merged
JukkaL merged 1 commit into
python:masterfrom
ilevkivskyi:native-parser-docstring
Aug 25, 2026
Merged

Preserve docstrings in the new parser#21890
JukkaL merged 1 commit into
python:masterfrom
ilevkivskyi:native-parser-docstring

Conversation

@ilevkivskyi

Copy link
Copy Markdown
Member

Old parser has some special treatment for docstrings. Match that in the new parser. Not adding tests, since some existing tests fail when switched to new parser, see #21823

cc @JukkaL

@github-actions

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

@JukkaL JukkaL left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks! I checked that the old parser uses clean=False with get_docstring, so we don't need to call inspect.cleandoc.

@JukkaL
JukkaL merged commit 1dab3c5 into python:master Aug 25, 2026
25 checks passed
@ilevkivskyi
ilevkivskyi deleted the native-parser-docstring branch August 25, 2026 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants