Skip to content

gh-140025: fix queue.SimpleQueue.__sizeof__() computation#140086

Closed
fatelei wants to merge 21 commits into
python:mainfrom
fatelei:issue-140025
Closed

gh-140025: fix queue.SimpleQueue.__sizeof__() computation#140086
fatelei wants to merge 21 commits into
python:mainfrom
fatelei:issue-140025

Conversation

@fatelei

@fatelei fatelei commented Oct 14, 2025

Copy link
Copy Markdown
Contributor

gh-140025 queue.SimpleQueue.sizeof() ignores the underlying data structure

@bedevere-app

bedevere-app Bot commented Oct 14, 2025

Copy link
Copy Markdown

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@bedevere-app

This comment was marked as duplicate.

@bedevere-app

This comment was marked as duplicate.

@picnixz picnixz changed the title fix: gh-140025 queue.SimpleQueue.__sizeof__() ignores the underlying … gh-140025: fix queue.SimpleQueue.__sizeof__() computation Oct 14, 2025

@ZeroIntensity ZeroIntensity left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Per the bot, please add a news entry. Please also avoid force-pushing; it makes things harder to review and we squash at the end anyway.

Comment thread Modules/_queuemodule.c
Comment thread Modules/_queuemodule.c
Comment thread Modules/_queuemodule.c Outdated
Comment thread Misc/NEWS.d/next/Library/2025-10-14-14-07-08.gh-issue-140025.zQ_Fhe.rst Outdated
Comment thread Lib/test/test_queue.py Outdated
Comment thread Modules/_queuemodule.c Outdated
Comment thread Lib/test/test_queue.py Outdated
Comment thread Lib/test/test_queue.py Outdated
Comment thread Lib/test/test_queue.py Outdated
Comment thread Lib/test/test_queue.py Outdated
Comment thread Modules/_queuemodule.c
Comment thread Misc/NEWS.d/next/Library/2025-10-14-14-07-08.gh-issue-140025.zQ_Fhe.rst Outdated

@picnixz picnixz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Overall feedback:

  • Implement the tests in PySimpleQueueTest and CSimpleQueueTest. They will be different becauss the impmementation is different.
  • Remove messages when assertions fail and when the condition being tested is self-explanatory.
  • Remove commenta for self-explanatory code.

Comment thread Lib/test/test_queue.py Outdated
Comment thread Lib/test/test_queue.py Outdated
Comment thread Lib/test/test_queue.py Outdated
Comment thread Lib/test/test_queue.py Outdated
Comment thread Lib/test/test_queue.py Outdated
Comment thread Lib/test/test_queue.py
@bedevere-app

bedevere-app Bot commented Oct 15, 2025

Copy link
Copy Markdown

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

Comment thread Modules/_queuemodule.c Outdated
@bedevere-app

bedevere-app Bot commented Oct 16, 2025

Copy link
Copy Markdown

Thanks for making the requested changes!

@picnixz: please review the changes made to this pull request.

@bedevere-app bedevere-app Bot requested a review from picnixz October 16, 2025 05:20

@picnixz picnixz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please be more careful with review feedback. I also feel that this PR was AI generated because the previous version tested equality which was not asked although one of my comment mentioned it. I am at the airport and will board in a few minutes so I will be less available for the next few days. If another core dev considers the PR to be in a mergeable state, please proceed even if I didn't leave another review.

Comment thread Lib/test/test_queue.py Outdated
Comment thread Lib/test/test_queue.py Outdated
Comment thread Lib/test/test_queue.py
Comment thread Lib/test/test_queue.py Outdated
@bedevere-app

bedevere-app Bot commented Oct 16, 2025

Copy link
Copy Markdown

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

Comment thread Lib/test/test_queue.py Outdated
@fatelei

fatelei commented Oct 16, 2025

Copy link
Copy Markdown
Contributor Author

I have made the requested changes; please review again.

@bedevere-app

bedevere-app Bot commented Oct 16, 2025

Copy link
Copy Markdown

Thanks for making the requested changes!

@picnixz: please review the changes made to this pull request.

@picnixz

picnixz commented Oct 16, 2025

Copy link
Copy Markdown
Member

The changes made are more and more unrelated and I do not understand why. As I am now going offline I will ask another core dev to review this thoroughly and check if my comments are addressed in the final version of that PR. I leave them the responsibility of removing the label as well

@StanFromIreland

Copy link
Copy Markdown
Member

Marking as "Awaiting changes" has comments have not been addressed.

@encukou

encukou commented Oct 21, 2025

Copy link
Copy Markdown
Member

Please restore the existing tests. Also, any new tests need to have distinct names.

@fatelei

fatelei commented Oct 21, 2025

Copy link
Copy Markdown
Contributor Author

Please restore the existing tests. Also, any new tests need to have distinct names.

exist test is not modified, only add PySimpleQueueTest and CSimpleQueueTest, i this two tests have distinct names

@picnixz

picnixz commented Oct 21, 2025

Copy link
Copy Markdown
Member

There are clearly unrelated changes. Please look at the diff. I also highly suspect that this PR was AI-generated, or at least AI-aided. If this is not changed, I think we should close this PR. Finally, please do not ignore comments by resolving them when they are still relevant.

@serhiy-storchaka serhiy-storchaka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Look at the sizeof tests for deque, OrderedDict and other collections.

Comment thread Lib/test/test_queue.py Outdated
@fatelei fatelei closed this Dec 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants