Skip to content
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

gh-120108: Fix deepcopying of AST trees with .parent attributes #120114

Merged
merged 6 commits into from
Jun 25, 2024

Conversation

JelleZijlstra
Copy link
Member

@JelleZijlstra JelleZijlstra commented Jun 5, 2024

Copy link
Contributor

@picnixz picnixz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments. I'll check them again once I am on my PC.

for child in ast.iter_child_nodes(node):
child.parent = node
try:
with support.infinite_recursion(200):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe bisect the exact recursion limit being needed so that we exactly know whether something changed or not?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should guarantee the exact number of stack frames needed for this test; future changes may mean we need slightly more or fewer. The point of the test is to ensure the number of stack frames does not grow to an unreasonable level.

Parser/asdl_c.py Outdated Show resolved Hide resolved
Parser/asdl_c.py Outdated Show resolved Hide resolved
Parser/asdl_c.py Outdated Show resolved Hide resolved
@JelleZijlstra
Copy link
Member Author

Merging this as it's been a few weeks and I want this to go into the next 3.13 beta.

@JelleZijlstra JelleZijlstra added the 🔨 test-with-refleak-buildbots Test PR w/ refleak buildbots; report in status section label Jun 25, 2024
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @JelleZijlstra for commit 00e1e3e 🤖

If you want to schedule another build, you need to add the 🔨 test-with-refleak-buildbots label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-refleak-buildbots Test PR w/ refleak buildbots; report in status section label Jun 25, 2024
@JelleZijlstra JelleZijlstra merged commit 42b2c9d into python:main Jun 25, 2024
45 checks passed
@miss-islington-app
Copy link

Thanks @JelleZijlstra for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

@JelleZijlstra JelleZijlstra deleted the astdeep branch June 25, 2024 15:12
@miss-islington-app
Copy link

Sorry, @JelleZijlstra, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 42b2c9d78da7ebd6bd5925a4d4c78aec3c9e78e6 3.13

JelleZijlstra added a commit to JelleZijlstra/cpython that referenced this pull request Jun 25, 2024
…ributes (pythonGH-120114)

(cherry picked from commit 42b2c9d)

Co-authored-by: Jelle Zijlstra <[email protected]>
JelleZijlstra added a commit to JelleZijlstra/cpython that referenced this pull request Jun 25, 2024
…ributes (pythonGH-120114)

(cherry picked from commit 42b2c9d)

Co-authored-by: Jelle Zijlstra <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented Jun 25, 2024

GH-121000 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Jun 25, 2024
JelleZijlstra added a commit that referenced this pull request Jun 25, 2024
noahbkim pushed a commit to hudson-trading/cpython that referenced this pull request Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants