8000 gh-119698: fix `symtable.Class.get_methods` and document its behaviour correctly by picnixz · Pull Request #120151 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-119698: fix symtable.Class.get_methods and document its behaviour correctly #120151

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 24 commits into from
Jun 20, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixup
  • Loading branch information
picnixz committed Jun 8000 6, 2024
commit f795499f5ee200292e276642601944ca6aab5369
20 changes: 10 additions & 10 deletions Doc/library/symtable.rst
4D4C
Original file line number Diff line number Diff line change
Expand Up @@ -131,16 +131,16 @@ Examining Symbol Tables
in the class.

Note that the term 'method' here designates *any* function directly
declared via :keyword:`def` inside the class body. For instance:

>>> import symtable
>>> st = symtable.symtable("class A:\n"
... " def f(): pass\n"
... " def g(self): pass\n",
... "test", "exec")
>>> class_A = st.get_children()[0]
>>> class_A.get_methods()
('f', 'g')
declared via :keyword:`def` inside the class body. For instance::

>>> import symtable
>>> st = symtable.symtable("class A:\n"
... " def f(): pass\n"
... " def g(self): pass\n",
... "test", "exec")
>>> class_A = st.get_children()[0]
>>> class_A.get_methods()
('f', 'g')

.. class:: Symbol

Expand Down
0