FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-99350: Fix symtable.SymbolTable.is_nested() documentation by iamsharduld · Pull Request #151901 · python/cpython · GitHub

/ cpython Public

gh-99350: Fix symtable.SymbolTable.is_nested() documentation - #151901

Open
iamsharduld wants to merge 1 commit into
python:mainfrom
iamsharduld:local-gh-99350-symtable-isnested-doc
Open

gh-99350: Fix symtable.SymbolTable.is_nested() documentation#151901
iamsharduld wants to merge 1 commit into
python:mainfrom
iamsharduld:local-gh-99350-symtable-isnested-doc

Conversation

iamsharduld commented Jun 22, 2026
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Contributor

The docstring and library reference described is_nested() as returning True
for "a nested class or function", which wrongly implies any nesting. The
underlying flag is only set when the block is nested (directly or indirectly)
within a function, so for example a method of a top-level class returns False.

Reword both descriptions and add a characterizing assertion to test_nested
(a method of a top-level class is not nested).

The docstring and library reference described is_nested() as returning True
for 'a nested class or function', which wrongly implies any nesting. The
underlying flag is only set when the block is nested within a function, so a
method of a top-level class is not nested. Reword both descriptions and add a
characterizing assertion to test_nested.

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #33241467 | 📁 Comparing 3c0afd9 against main (24828e5)

  🔍 Preview build  

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

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant


Back | FazBrowse Home | New Git URL