Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

GH-127682: Only call__iter__ once in generator expressions.#132351

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
markshannon merged 6 commits intopython:mainfromfaster-cpython:fix-127682
Apr 11, 2025

Conversation

markshannon
Copy link
Member

@markshannonmarkshannon commentedApr 10, 2025
edited
Loading

Removes the extraGET_ITER instruction emitted when creating a generator expression.

This:

  • Allows iterables producing iterators than do not have an__iter__ method to be used in generator expressions, as they were up until 3.12.
  • Makes generator expressions behave the same as all other generators in this regard.

@markshannonmarkshannon merged commitd87e7f3 intopython:mainApr 11, 2025
42 checks passed
@miss-islington-app
Copy link

Thanks@markshannon for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

@markshannonmarkshannon deleted the fix-127682 branchApril 11, 2025 08:37
@miss-islington-app
Copy link

Sorry,@markshannon, I could not cleanly backport this to3.13 due to a conflict.
Please backport usingcherry_picker on command line.

cherry_picker d87e7f35297d34755026173d84a38eedfbed78de 3.13

@Fidget-Spinner
Copy link
Member

Do you need to bump the magic number here? I forgot if compiler-only changes need that.

@brandtbucher
Copy link
Member

I don’t think so, since the bytecode format and behavior is unchanged.

efimov-mikhail reacted with thumbs up emoji

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@iritkatrieliritkatrieliritkatriel approved these changes

Assignees

@markshannonmarkshannon

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

5 participants
@markshannon@Fidget-Spinner@brandtbucher@iritkatriel@hugovk

[8]ページ先頭

©2009-2025 Movatter.jp