GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||
GeezerVison is showing github.com — GH-94851: fix immortal objects refcounting in compiler by kumaraditya303 · Pull Request #95040 · python/cpython Conversation
|
|
@kumaraditya303 Thanks Kumar I was also curious about this code also when you submitted the related patch before.
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
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.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
If you follow the macro, it is capturing a reference to the new object so incref is required. See comment : |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
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}') |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Nice repro, thanks! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
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 an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
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.
There was an error while loading. Please reload this page.
|
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.
There was an error while loading. Please reload this page.
|
GH-95049 is a backport of this pull request to the 3.11 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…h-95040) (cherry picked from commit 7476154) Co-authored-by: Kumar Aditya <[email protected]>
|
I will merge backport patch after my dinner :) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
(cherry picked from commit 7476154) Co-authored-by: Kumar Aditya <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.