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-145667: MergeGET_ITER andGET_YIELD_FROM_ITER#146120

Merged
markshannon merged 4 commits intopython:mainfrom
markshannon:breakup-yield-from-iter
Mar 21, 2026
Merged

GH-145667: MergeGET_ITER andGET_YIELD_FROM_ITER#146120
markshannon merged 4 commits intopython:mainfrom
markshannon:breakup-yield-from-iter

Conversation

@markshannon
Copy link
Member

@markshannonmarkshannon commentedMar 18, 2026
edited
Loading

Also modifiesSEND to make it a bit more like FOR_ITER as both are now fed byGET_ITER.

Apart from saving an opcode, this will enable broadly similar optimizations to be applied toSEND as are already applied toFOR_ITER. Which will be able to:

  • significantly improve the performance ofyield from seq whereseq is a common iterable, likelist.
  • allow the JIT to trace throughSEND as it will be mostly specialized.

For now, this is broadly performance neutral, between +0% and -1%, mostly about 0%.

Copy link
Contributor

@diegorussodiegorusso left a comment

Choose a reason for hiding this comment

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

Just a nit

@Fidget-Spinner
Copy link
Member

Just to be sure, please run the buildbots

markshannon reacted with thumbs up emoji

@markshannonmarkshannon added the 🔨 test-with-buildbotsTest PR w/ buildbots; report in status section labelMar 20, 2026
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by@markshannon for commite3ea233 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F146120%2Fmerge

If you want to schedule another build, you need to add the🔨 test-with-buildbots label again.

@bedevere-botbedevere-bot removed the 🔨 test-with-buildbotsTest PR w/ buildbots; report in status section labelMar 20, 2026
@markshannonmarkshannon added the 🔨 test-with-buildbotsTest PR w/ buildbots; report in status section labelMar 20, 2026
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by@markshannon for commit1b8f043 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F146120%2Fmerge

If you want to schedule another build, you need to add the🔨 test-with-buildbots label again.

@bedevere-botbedevere-bot removed the 🔨 test-with-buildbotsTest PR w/ buildbots; report in status section labelMar 20, 2026
@markshannon
Copy link
MemberAuthor

Of the 12 failing buildbots, 7 were pre-existing failures and 5 are "new" refleaks.
I put "new" in quotes as there is no easy way to tell whether they were introduced by this PR, another recent PR, or merely exposed by this PR.

However, since this PR is platform independent, there should be leaks everywhere or nowhere.
Also, ifGET_ITER orSEND were leaking, then there would be lots of refleaks on many buildbots (and there aren't).

@markshannonmarkshannon merged commit879c85f intopython:mainMar 21, 2026
147 of 160 checks passed
@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure⚠️⚠️⚠️

Hi! The buildbotARM64 MacOS M1 Refleaks NoGIL 3.x (tier-2) has failed when building commit879c85f.

What do you need to do:

  1. Don't panic.
  2. Checkthe buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/1368/builds/4857) and take a look at the build logs.
  4. Check if the failure is related to this commit (879c85f) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/1368/builds/4857

Failed tests:

  • test_urllib2net

Summary of the results of the build (if available):

==

Click to see traceback logs
remote:Enumerating objects: 80, done.remote:Counting objects:   1% (1/66)remote:Counting objects:   3% (2/66)remote:Counting objects:   4% (3/66)remote:Counting objects:   6% (4/66)remote:Counting objects:   7% (5/66)remote:Counting objects:   9% (6/66)remote:Counting objects:  10% (7/66)remote:Counting objects:  12% (8/66)remote:Counting objects:  13% (9/66)remote:Counting objects:  15% (10/66)remote:Counting objects:  16% (11/66)remote:Counting objects:  18% (12/66)remote:Counting objects:  19% (13/66)remote:Counting objects:  21% (14/66)remote:Counting objects:  22% (15/66)remote:Counting objects:  24% (16/66)remote:Counting objects:  25% (17/66)remote:Counting objects:  27% (18/66)remote:Counting objects:  28% (19/66)remote:Counting objects:  30% (20/66)remote:Counting objects:  31% (21/66)remote:Counting objects:  33% (22/66)remote:Counting objects:  34% (23/66)remote:Counting objects:  36% (24/66)remote:Counting objects:  37% (25/66)remote:Counting objects:  39% (26/66)remote:Counting objects:  40% (27/66)remote:Counting objects:  42% (28/66)remote:Counting objects:  43% (29/66)remote:Counting objects:  45% (30/66)remote:Counting objects:  46% (31/66)remote:Counting objects:  48% (32/66)remote:Counting objects:  50% (33/66)remote:Counting objects:  51% (34/66)remote:Counting objects:  53% (35/66)remote:Counting objects:  54% (36/66)remote:Counting objects:  56% (37/66)remote:Counting objects:  57% (38/66)remote:Counting objects:  59% (39/66)remote:Counting objects:  60% (40/66)remote:Counting objects:  62% (41/66)remote:Counting objects:  63% (42/66)remote:Counting objects:  65% (43/66)remote:Counting objects:  66% (44/66)remote:Counting objects:  68% (45/66)remote:Counting objects:  69% (46/66)remote:Counting objects:  71% (47/66)remote:Counting objects:  72% (48/66)remote:Counting objects:  74% (49/66)remote:Counting objects:  75% (50/66)remote:Counting objects:  77% (51/66)remote:Counting objects:  78% (52/66)remote:Counting objects:  80% (53/66)remote:Counting objects:  81% (54/66)remote:Counting objects:  83% (55/66)remote:Counting objects:  84% (56/66)remote:Counting objects:  86% (57/66)remote:Counting objects:  87% (58/66)remote:Counting objects:  89% (59/66)remote:Counting objects:  90% (60/66)remote:Counting objects:  92% (61/66)remote:Counting objects:  93% (62/66)remote:Counting objects:  95% (63/66)remote:Counting objects:  96% (64/66)remote:Counting objects:  98% (65/66)remote:Counting objects: 100% (66/66)remote:Counting objects: 100% (66/66), done.remote:Compressing objects:   3% (1/30)remote:Compressing objects:   6% (2/30)remote:Compressing objects:  10% (3/30)remote:Compressing objects:  13% (4/30)remote:Compressing objects:  16% (5/30)remote:Compressing objects:  20% (6/30)remote:Compressing objects:  23% (7/30)remote:Compressing objects:  26% (8/30)remote:Compressing objects:  30% (9/30)remote:Compressing objects:  33% (10/30)remote:Compressing objects:  36% (11/30)remote:Compressing objects:  40% (12/30)remote:Compressing objects:  43% (13/30)remote:Compressing objects:  46% (14/30)remote:Compressing objects:  50% (15/30)remote:Compressing objects:  53% (16/30)remote:Compressing objects:  56% (17/30)remote:Compressing objects:  60% (18/30)remote:Compressing objects:  63% (19/30)remote:Compressing objects:  66% (20/30)remote:Compressing objects:  70% (21/30)remote:Compressing objects:  73% (22/30)remote:Compressing objects:  76% (23/30)remote:Compressing objects:  80% (24/30)remote:Compressing objects:  83% (25/30)remote:Compressing objects:  86% (26/30)remote:Compressing objects:  90% (27/30)remote:Compressing objects:  93% (28/30)remote:Compressing objects:  96% (29/30)remote:Compressing objects: 100% (30/30)remote:Compressing objects: 100% (30/30), done.remote:Total 80 (delta 40), reused 36 (delta 36), pack-reused 14 (from 2)From https://github.com/python/cpython * branch                    main       -> FETCH_HEADNote:switching to '879c85f6e4ca8424ff6b4fddfbc946889572bf13'.You are in 'detached HEAD' state. You can look around, make experimentalchanges and commit them, and you can discard any commits you make in thisstate without impacting any branches by switching back to a branch.If you want to create a new branch to retain commits you create, you maydo so (now or later) by using -c with the switch command. Example:  git switch -c <new-branch-name>Or undo this operation with:  git switch -Turn off this advice by setting config variable advice.detachedHead to falseHEAD is now at 879c85f6e4c GH-145667: Merge `GET_ITER` and `GET_YIELD_FROM_ITER` (GH-146120)Switched to and reset branch 'main'configure:WARNING: pkg-config is missing. Some dependencies may not be detected correctly.make:*** [buildbottest] Error 2

CuriousLearner added a commit to CuriousLearner/cpython that referenced this pull requestMar 22, 2026
* upstream/main: (1475 commits)  Docs: replace all `datetime` imports with `import datetime as dt` (python#145640)pythongh-146153: Use `frozendict` in pure python fallback for `curses.has_key` (python#146154)pythongh-138234: clarify returncode behavior for subprocesses created with `shell=True` (python#138536)pythongh-140947: fix contextvars handling for server tasks in asyncio  (python#141158)pythonGH-100108: Add async generators best practices section (python#141885)pythonGH-145667: Merge `GET_ITER` and `GET_YIELD_FROM_ITER` (pythonGH-146120)pythongh-146228: Better fork support in cached FastPath (python#146231)pythongh-146227: Fix wrong type in _Py_atomic_load_uint16 in pyatomic_std.h (pythongh-146229)pythongh-145980: Fix copy/paste mistake in binascii.c (python#146230)pythongh-146092: Raise MemoryError on allocation failure in _zoneinfo (python#146165)pythongh-91279: Note `SOURCE_DATE_EPOCH` support in `ZipFile.writestr()` doc (python#139396)pythongh-146196: Fix Undefined Behavior in _PyUnicodeWriter_WriteASCIIString() (python#146201)pythongh-143930: Reject leading dashes in webbrowser URLspythongh-145916: Soft-deprecate ctypes.util.find_library (pythonGH-145919)pythongh-146205: Check the errno with != 0 in close impls in select module (python#146206)pythongh-146171: Fix nested AttributeError suggestions (python#146188)pythongh-146099: Optimize _GUARD_CODE_VERSION+IP via function version symbols (pythonGH-146101)pythongh-145980: Add support for alternative alphabets in the binascii module (pythonGH-145981)pythongh-145754: Update signature retrieval in unittest.mock to use forwardref annotation format (python#145756)pythongh-145177: Add emscripten run --test, uses test args from config.toml (python#146160)  ...
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@diegorussodiegorussodiegorusso approved these changes

@pablogsalpablogsalAwaiting requested review from pablogsalpablogsal is a code owner

@tomasr8tomasr8Awaiting requested review from tomasr8tomasr8 is a code owner

@Fidget-SpinnerFidget-SpinnerAwaiting requested review from Fidget-SpinnerFidget-Spinner is a code owner

@savannahostrowskisavannahostrowskiAwaiting requested review from savannahostrowskisavannahostrowski is a code owner

@ericsnowcurrentlyericsnowcurrentlyAwaiting requested review from ericsnowcurrentlyericsnowcurrently is a code owner

@iritkatrieliritkatrielAwaiting requested review from iritkatrieliritkatriel is a code owner

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

5 participants

@markshannon@Fidget-Spinner@bedevere-bot@diegorusso@savannahostrowski

[8]ページ先頭

©2009-2026 Movatter.jp