Skip to content

bpo-44553 : Implement GC methods for types.Union #26993

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

Merged
merged 3 commits into from
Jul 3, 2021

Conversation

Fidget-Spinner
Copy link
Member

@Fidget-Spinner Fidget-Spinner commented Jul 2, 2021

Copy link
Member

@serhiy-storchaka serhiy-storchaka left a comment

Choose a reason for hiding this comment

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

LGTM. I have just few nitpicks to the tests.

@serhiy-storchaka serhiy-storchaka added the type-bug An unexpected behavior, bug, or error label Jul 3, 2021
@serhiy-storchaka serhiy-storchaka merged commit 1097384 into python:main Jul 3, 2021
@miss-islington
Copy link
Contributor

Thanks @Fidget-Spinner for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 3, 2021
@bedevere-bot bedevere-bot removed the needs backport to 3.10 only security fixes label Jul 3, 2021
@bedevere-bot
Copy link

GH-27002 is a backport of this pull request to the 3.10 branch.

@Fidget-Spinner Fidget-Spinner deleted the union_gc branch July 3, 2021 12:56
miss-islington added a commit that referenced this pull request Jul 3, 2021
(cherry picked from commit 1097384)

Co-authored-by: Ken Jin <[email protected]>
@pablogsal
Copy link
Member

if (result == NULL) {
return NULL;
}

result->args = dedup_and_flatten_args(args);
if (result->args == NULL) {
Py_DECREF(result);
PyObject_GC_Del(result);
Copy link
Member

@pablogsal pablogsal Jul 3, 2021

Choose a reason for hiding this comment

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

This is incorrect, this should still be Py_DECREF, PyObject_GC_Del cannot be called like that because it overrides a bunch of cleanups like the call to _Py_ForgetReference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants