Behavior of symtable module changed, but not seen on docs

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.

cc: @carljm

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

Thanks for reporting this omission, @yunline !

2 Likes