Skip to content

Conversation

@sobolevn
Copy link
Member

@sobolevnsobolevn commented Oct 9, 2023

This corner case cannot be covered from Python code, as far as I can tell. But, it is documented:

 Also works with :class:`frozenset` instances (like :c:func:`PyTuple_SetItem` it can be used to fill in the values of brand new frozensets before they are exposed to other code).

So, I think we need to test it as well in C code. Sorry for missing this in the original PR!

Copy link
Member

@serhiy-storchakaserhiy-storchaka left a comment

Choose a reason for hiding this comment

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

There is a leak of num.

@sobolevn
Copy link
MemberAuthor

sobolevn commented Oct 9, 2023

Thanks for the catch! Fixed.

Copy link
Member

@serhiy-storchakaserhiy-storchaka left a comment

Choose a reason for hiding this comment

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

Yes, and fs.

@sobolevn
Copy link
MemberAuthor

Counting references in your head is exausting!
If only we had better languages for this 🐍 🦀

@serhiy-storchaka
Copy link
Member

Then we probably wouldn't need Python.

@serhiy-storchakaserhiy-storchaka merged commit ea39c87 into python:mainOct 9, 2023
@serhiy-storchakaserhiy-storchaka added the needs backport to 3.12 only security fixes label Oct 9, 2023
@miss-islington
Copy link
Contributor

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

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 9, 2023
…ythonGH-110544) (cherry picked from commit ea39c87) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
@bedevere-app
Copy link

GH-110554 is a backport of this pull request to the 3.12 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.12 only security fixes label Oct 9, 2023
serhiy-storchaka pushed a commit that referenced this pull request Oct 9, 2023
…H-110544) (GH-110554) (cherry picked from commit ea39c87) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@sobolevn@serhiy-storchaka@miss-islington