Skip to content

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

@iamsharduld iamsharduld commented Jun 22, 2026

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.
@read-the-docs-community

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

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