Skip to content

gh-131798: split recursion check to _CHECK_RECURSION_LIMIT and combine checks#148070

Merged
Fidget-Spinner merged 3 commits intopython:mainfrom
kumaraditya303:recursion
Apr 4, 2026
Merged

gh-131798: split recursion check to _CHECK_RECURSION_LIMIT and combine checks#148070
Fidget-Spinner merged 3 commits intopython:mainfrom
kumaraditya303:recursion

Conversation

@kumaraditya303
Copy link
Copy Markdown
Contributor

@kumaraditya303 kumaraditya303 commented Apr 4, 2026

@Fidget-Spinner Fidget-Spinner changed the title gh-131798: split recursion check to _CHECK_RECURSION_LIMIT gh-131798: split recursion check to _CHECK_RECURSION_LIMIT and comine checks Apr 4, 2026
@kumaraditya303 kumaraditya303 changed the title gh-131798: split recursion check to _CHECK_RECURSION_LIMIT and comine checks gh-131798: split recursion check to _CHECK_RECURSION_LIMIT and combine checks Apr 4, 2026
Copy link
Copy Markdown
Member

@Fidget-Spinner Fidget-Spinner left a comment

Choose a reason for hiding this comment

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

The key idea here is to combine recursion stack space limit checks into the first one. This is safe to do per-frame as subsequent calls should always return the frame to the same state according to how calls in C work.

Note that this is NOT the py recursion limit, which will require executor invalidation during sys setrecursionlimit to handle.

@Fidget-Spinner Fidget-Spinner merged commit e7bf8ea into python:main Apr 4, 2026
114 of 117 checks passed
@kumaraditya303 kumaraditya303 deleted the recursion branch April 4, 2026 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants