Skip to content

gh-153528: Document mode="func_type" in compile() - #153561

Merged
JelleZijlstra merged 2 commits into
python:mainfrom
pranavchoudhary-tech:fix-compile-func-type-doc-clean
Oct 23, 2026
Merged

JelleZijlstra merged 2 commits into
python:mainfrom
pranavchoudhary-tech:fix-compile-func-type-doc-clean

Conversation

@pranavchoudhary-tech

Copy link
Copy Markdown
Contributor

Fixes #153528.

This adds a brief documentation note to compile() explaining the func_type mode and linking it to ast.parse for more details.

(Note: This replaces the previous PR #153542 which was accidentally submitted with unrelated commits from another branch).

@bedevere-app bedevere-app Bot added the docs Documentation in the Doc dir label Jul 11, 2026
@github-project-automation github-project-automation Bot moved this to Todo in Docs PRs Jul 11, 2026
@read-the-docs-community

read-the-docs-community Bot commented Jul 11, 2026 •

Copy link
Copy Markdown

@aisk

aisk commented Jul 11, 2026

Copy link
Copy Markdown
Member

According to the Dev Guide, document changes don't need a news entry file.

@aisk aisk added the skip news label Jul 11, 2026
@pranavchoudhary-tech

Copy link
Copy Markdown
Contributor Author

@aisk Done! I've removed the NEWS entry. Thanks!

@github-actions

Copy link
Copy Markdown

This PR is stale because it has been open for 90 days with no activity.

@github-actions github-actions Bot added the stale Stale PR or inactive for long period of time. label Oct 12, 2026
@pranavchoudhary-tech
pranavchoudhary-tech force-pushed the fix-compile-func-type-doc-clean branch from 01a5dcd to 670b8db Compare October 12, 2026 05:28
@pranavchoudhary-tech

Copy link
Copy Markdown
Contributor Author

Rebased onto the latest main branch and resolved the merge conflict caused by the recent documentation move into Doc/builtins/. The branch is up to date and ready for review.

Comment thread Doc/builtins/functions.rst Outdated
Comment thread Doc/builtins/functions.rst Outdated
interactive statement (in the latter case, expression statements that
evaluate to something other than ``None`` will be printed).
It can also be ``'func_type'`` if *source* consists of a single :pep:`484`
signature type comment; see :func:`ast.parse` for more information.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It's better to add a versionchanged section to mention which version this type was added

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added mode='func_type' to the versionchanged:: 3.8 directive.

@pranavchoudhary-tech
pranavchoudhary-tech force-pushed the fix-compile-func-type-doc-clean branch from 670b8db to 1803b81 Compare October 13, 2026 06:28
Comment thread Doc/builtins/functions.rst Outdated
@pranavchoudhary-tech
pranavchoudhary-tech force-pushed the fix-compile-func-type-doc-clean branch from 1803b81 to ed5a5f0 Compare October 13, 2026 06:46
@aisk aisk added needs backport to 3.14 bugs and security fixes needs backport to 3.15 bugs and security fixes and removed stale Stale PR or inactive for long period of time. labels Oct 13, 2026
Comment thread Doc/builtins/functions.rst Outdated
@JelleZijlstra
JelleZijlstra enabled auto-merge (squash) October 23, 2026 19:46
@JelleZijlstra
JelleZijlstra merged commit 02c5d55 into python:main Oct 23, 2026
30 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in Docs PRs Oct 23, 2026
@miss-islington-app

Copy link
Copy Markdown

Thanks @pranavchoudhary-tech for the PR, and @JelleZijlstra for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14, 3.15.
🐍🍒⛏🤖

@bedevere-app

bedevere-app Bot commented Oct 23, 2026

Copy link
Copy Markdown

GH-160479 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 bugs and security fixes label Oct 23, 2026
@bedevere-app

bedevere-app Bot commented Oct 23, 2026

Copy link
Copy Markdown

GH-160481 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Oct 23, 2026
@vstinner

Copy link
Copy Markdown
Member

Thanks for documenting func_type.

JelleZijlstra pushed a commit that referenced this pull request Oct 24, 2026
…) (#160479)

(cherry picked from commit 02c5d55)

Co-authored-by: Pranav Choudhary <pranav.nstblr@gmail.com>
JelleZijlstra pushed a commit that referenced this pull request Oct 24, 2026
…) (#160481)

(cherry picked from commit 02c5d55)

Co-authored-by: Pranav Choudhary <pranav.nstblr@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir skip news

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

compile(): func_type mode is not documented

4 participants