-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
gh-132775: Add _PyCode_GetVarCounts() #133128
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-132775: Add _PyCode_GetVarCounts() #133128
Conversation
Objects/codeobject.c
Outdated
|
||
// Get the unbound counts. | ||
struct co_unbound_counts unbound = { | ||
.total = PyTuple_GET_SIZE(co->co_names), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
compiler warning here
LGTM. But I'd run the refleaks buildbots before merging. |
|
|
FYI, I'm looking into the failures. |
This reverts commit 94b4fcd.
This reverts commit 811edcf (pythongh-133128).
This helper is useful in a variety of ways, including in demonstrating how the different counts relate to one another.
It will be used in a later change to help identify if a function is "stateless", meaning it doesn't have any free vars or globals.
Note that a majority of this change is tests.