Per the accepted Ideas discussion (https://discuss.python.org/t/the-itertools-chain-from-iterable-and-itertools-chain-should-include-a-note-referring-to-pep-798-alternatives/107921), the itertools.chain.from_iterable docs should gain a short note pointing readers to the inline unpacking-in-comprehension form added by PEP 798 (e.g. (*it for it in iterables)), as a more readable alternative for simple flattening on 3.15+.
Docs-only; no change to the "roughly equivalent" code, and no deprecation — chain / from_iterable remain useful as first-class callables and for earlier versions.
Activity
Twix1288 commented on Jun 27, 2026
I'd like to work on this. Will submit a PR with a .. note:: block in Doc/library/itertools.rst pointing to PEP 798.
rhettinger commented on Jun 27, 2026
Fixed in #152454.
Added you as a coauthor.
Thank you for the suggestion.
[3.15] gh-152397: Provide a cross-reference to PEP 798 unpacking synt…