Skip to content

gh-62172: Document findsource() and getblock() in inspect#153628

Open
sreehariannam wants to merge 1 commit into
python:mainfrom
sreehariannam:gh-62172-inspect-docs-2
Open

gh-62172: Document findsource() and getblock() in inspect#153628
sreehariannam wants to merge 1 commit into
python:mainfrom
sreehariannam:gh-62172-inspect-docs-2

Conversation

@sreehariannam

Copy link
Copy Markdown

Continues gh-62172 (see #153624 for the first batch: classify_class_attrs, getabsfile, indentsize). This adds documentation for two more public, __all__-exported inspect functions that were missing from Doc/library/inspect.rst:

  • inspect.findsource()
  • inspect.getblock()

There was an earlier attempt at documenting findsource in #6992, which a core reviewer approved with a minor suggestion (mention that findsource doesn't unwrap decorated callables like getsourcelines does) before it went stale and was closed. That suggestion is incorporated here.

Remaining undocumented functions from gh-62172 (walktree, getargs, formatannotation, formatannotationrelativeto, getlineno) are left for follow-up PRs to keep this reviewable.

Verified with sphinx-lint (no issues).

@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #33555136 | 📁 Comparing d5f01a8 against main (832bc0b)

  🔍 Preview build  

2 files changed
± library/inspect.html
± whatsnew/changelog.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review docs Documentation in the Doc dir skip news

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

1 participant