| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
@kumaraditya303 Thanks Kumar I was also curious about this code also when you submitted the related patch before.
|
Sorry, something went wrong.
it depends on its usage, if you are owning the object or returning it from a function then incref is required else it is not required. |
Sorry, something went wrong.
If you follow the macro, it is capturing a reference to the new object so incref is required. See comment : /* Same as ADDOP_LOAD_CONST, but steals a reference. */ |
Sorry, something went wrong.
a = 1
print(f'{a:d} {a:d} {a:d} {a:d} {a:d} {a:d} {a:d} {a:d} {a:d} {a:d} {a:d} {a:d} {a:d} {a:d} {a:d} {a:d} {a:d} {a:d} {a:d} {a:d} {a:d} {a:d} {a:d} {a:d} {a:d} {a:d} {a:d} {a:d} {a:d} {a:d} {a:d} {a:d} {a:d} {a:d} {a:d} {a:d} {a:d} {a:d} {a:d}')./python.exe -X showrefcount tt.py 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [-1 refs, 0 blocks] |
Sorry, something went wrong.
Nice repro, thanks! |
Sorry, something went wrong.
|
And I checked that your patch fix this issue. ./python.exe -X showrefcount tt.py
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
[0 refs, 0 blocks] |
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM.
Please submit the reproducible code if possible it can reduce the reviewer's time and help understanding context :)
I know your patch is correct but reproducible code makes sure what your patch fixes exactly.
Sorry, something went wrong.
|
Thanks @kumaraditya303 for the PR, and @corona10 for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11. |
Sorry, something went wrong.
|
GH-95049 is a backport of this pull request to the 3.11 branch. |
Sorry, something went wrong.
|
I will merge backport patch after my dinner :) |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Found while working on #95001