yunline
(云line)
September 10, 2023, 1:54am
1
script = """
[[i for i in range(10)],[j for j in range(10)]]
"""
symt = symtable.symtable(script, "test.py", "exec")
print(symt.get_children())
3.10
[<Function SymbolTable for listcomp in test.py>, <Function SymbolTable for listcomp in test.py>]
3.11
[<Function SymbolTable for listcomp in test.py>, <Function SymbolTable for listcomp in test.py>]
3.12
[]
Is this change causes by PEP-709? I didn’t see this change on symtable doc page .
carljm
(Carl Meyer)
September 10, 2023, 7:35pm
3
Yes, this is due to PEP 709. I don’t think it makes sense to mention this on the symtable doc page; that page does not document or guarantee any specific symtable results for specific code constructs. I can add this to the What’s New doc entry for PEP 709 as an observable effect, though.
4 Likes
carljm
(Carl Meyer)
September 11, 2023, 11:49pm
4
python:main
← carljm:709wn
opened 11:48PM - 11 Sep 23 UTC
<!--
Thanks for your contribution!
Please read this comment in its entirety. I… t's quite important.
# Pull Request title
It should be in the following format:
```
gh-NNNNN: Summary of the changes made
```
Where: gh-NNNNN refers to the GitHub issue number.
Most PRs will require an issue number. Trivial changes, like fixing a typo, do not need an issue.
# Backport Pull Request title
If this is a backport PR (PR made against branches other than `main`),
please ensure that the PR title is in the following format:
```
[X.Y] <title from the original PR> (GH-NNNN)
```
Where: [X.Y] is the branch name, e.g. [3.6].
GH-NNNN refers to the PR number from `main`.
-->
* Issue: gh-109292
----
:books: Documentation preview :books:: https://cpython-previews--109293.org.readthedocs.build/
Thanks for reporting this omission, @yunline !
2 Likes