Skip to content
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

gh-126341: added release check to iteration method of memoryview object #126759

Merged
merged 10 commits into from
Nov 13, 2024

Conversation

ritvikpasham
Copy link
Contributor

@ritvikpasham ritvikpasham commented Nov 12, 2024

Copy link

cpython-cla-bot bot commented Nov 12, 2024

All commit authors signed the Contributor License Agreement.
CLA signed

@bedevere-app
Copy link

bedevere-app bot commented Nov 12, 2024

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.

Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

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

Please, add a test case.

@bedevere-app
Copy link

bedevere-app bot commented Nov 12, 2024

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.

And if you don't make the requested changes, you will be put in the comfy chair!

Copy link
Member

@ZeroIntensity ZeroIntensity left a comment

Choose a reason for hiding this comment

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

Thanks for contributing :)

You should be able to use the reproducer from the issue as a test case.

@ritvikpasham
Copy link
Contributor Author

I have made the requested changes; please review again.

@bedevere-app
Copy link

bedevere-app bot commented Nov 12, 2024

Thanks for making the requested changes!

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

@bedevere-app bedevere-app bot requested a review from sobolevn November 12, 2024 20:18
Copy link
Member

@ZeroIntensity ZeroIntensity left a comment

Choose a reason for hiding this comment

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

I don't think we need a whole new file for the test, as it's only a 3 line reproducer. You could just add it alongside the existing tests for memoryview iteration.

Lib/test/memoryview/test_released_iter.py Outdated Show resolved Hide resolved
@ritvikpasham
Copy link
Contributor Author

I don't think we need a whole new file for the test, as it's only a 3 line reproducer. You could just add it alongside the existing tests for memoryview iteration.

Yeah, that makes sense! Would you happen to know where the memoryview iteration tests are?

@ZeroIntensity
Copy link
Member

ZeroIntensity commented Nov 12, 2024

I don't, but you can just CTRL+F iter in the memoryview tests and you'll probably find it :)

@ritvikpasham
Copy link
Contributor Author

It look like there was a previous test case that tests CHECK_RELEASED, so I just added a check to the iter method there.

Copy link
Member

@ZeroIntensity ZeroIntensity left a comment

Choose a reason for hiding this comment

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

Thank you!

…e-126341.5SdAe1.rst

Co-authored-by: sobolevn <mail@sobolevn.me>
Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for adding a non-regression test!

@vstinner vstinner added needs backport to 3.12 bug and security fixes needs backport to 3.13 bugs and security fixes labels Nov 13, 2024
@vstinner
Copy link
Member

@sobolevn: I let you review the updated PR. You can merge it if it looks good to you.

Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

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

Thanks!

@sobolevn sobolevn enabled auto-merge (squash) November 13, 2024 11:39
@sobolevn
Copy link
Member

Should we backport this change?

@ZeroIntensity
Copy link
Member

I think so, it's a bugfix.

@sobolevn sobolevn merged commit a12690e into python:main Nov 13, 2024
47 checks passed
@miss-islington-app
Copy link

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

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 13, 2024
…w` (pythonGH-126759)

(cherry picked from commit a12690e)

Co-authored-by: Ritvik Pasham <ritvikpasham@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: sobolevn <mail@sobolevn.me>
@bedevere-app
Copy link

bedevere-app bot commented Nov 13, 2024

GH-126778 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Nov 13, 2024
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 13, 2024
…w` (pythonGH-126759)

(cherry picked from commit a12690e)

Co-authored-by: Ritvik Pasham <ritvikpasham@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: sobolevn <mail@sobolevn.me>
@bedevere-app
Copy link

bedevere-app bot commented Nov 13, 2024

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

@bedevere-app bedevere-app bot removed the needs backport to 3.12 bug and security fixes label Nov 13, 2024
@ZeroIntensity
Copy link
Member

Congrats on your first contribution @ritvikpasham 🎉

Eclips4 pushed a commit that referenced this pull request Nov 13, 2024
…ew` (GH-126759) (#126779)

gh-126341: add release check to `__iter__` method of `memoryview` (GH-126759)
(cherry picked from commit a12690e)

Co-authored-by: Ritvik Pasham <ritvikpasham@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: sobolevn <mail@sobolevn.me>
Eclips4 pushed a commit that referenced this pull request Nov 13, 2024
…ew` (GH-126759) (#126778)

gh-126341: add release check to `__iter__` method of `memoryview` (GH-126759)
(cherry picked from commit a12690e)

Co-authored-by: Ritvik Pasham <ritvikpasham@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: sobolevn <mail@sobolevn.me>
picnixz pushed a commit to picnixz/cpython that referenced this pull request Dec 8, 2024
…w` (python#126759)

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: sobolevn <mail@sobolevn.me>
ebonnal pushed a commit to ebonnal/cpython that referenced this pull request Jan 12, 2025
…w` (python#126759)

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: sobolevn <mail@sobolevn.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants