Thanks to visit codestin.com
Credit goes to github.com

Skip to content
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
update comments
  • Loading branch information
picnixz committed Jun 8, 2024
commit 1352d0856ba7d513d341a29b30675312d98f145c
8 changes: 5 additions & 3 deletions Lib/symtable.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,13 +231,15 @@ def is_local_symbol(ident):
if is_local_symbol(st.name):
if st.type == _symtable.TYPE_TYPE_PARAM:
# Current 'st' is an annotation scope with one or
# more children (we expect only one, but ,
# so we need to find the corresponding inner function,
# class or type alias.
# more children (we expect only one, but we might
# have more in the future). In particular, we need
# to find the corresponding inner function, class or
# type alias.
st = next((c for c in st.children if c.name == st.name), None)
# if 'st' is None, then the annotation scopes are broken
assert st is not None, 'annotation scopes are broken'

# only select function-like symbols
if st.type == _symtable.TYPE_FUNCTION:
d[st.name] = 1
self.__methods = tuple(d)
Expand Down