Skip to content

Conversation

@ferdnyc
Copy link
Contributor

@ferdnyc ferdnyc commented Jun 17, 2024

Since @rhettinger migrated the itertools examples to concise demonstrations in the table(s) of functions (back in 2009, commit 5bfd8ce), groupby() and tee() have lacked examples of their function.

While somewhat less revelatory than the other examples, concise illustrations of their purpose does seem possible. I feel that presenting examples has sufficient merit, particularly for less experienced developers, that it's worth attempting to do so. (Particularly because, in the case of tee, I don't find the "Results"-column description particularly clear or explanatory.)

These are my attempts at demonstrating the two tools via brief code snippets, in a manner similar to how all the other functions are documented. Like the other examples, the details of unpacking the returned iterators are glossed over, showing only the values ultimately produced.


📚 Documentation preview 📚: https://cpython-previews--120618.org.readthedocs.build/

@ferdnyc ferdnyc requested a review from rhettinger as a code owner June 17, 2024 08:25
@bedevere-app bedevere-app bot added docs Documentation in the Doc dir skip news awaiting review labels Jun 17, 2024
@rhettinger rhettinger self-assigned this Jun 17, 2024
@rhettinger rhettinger added skip issue needs backport to 3.12 only security fixes needs backport to 3.13 bugs and security fixes labels Jun 17, 2024
@rhettinger rhettinger merged commit 79e09e6 into python:main Jun 17, 2024
@miss-islington-app
Copy link

Thanks @ferdnyc for the PR, and @rhettinger 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 Jun 17, 2024
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 17, 2024
@bedevere-app
Copy link

bedevere-app bot commented Jun 17, 2024

GH-120637 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 Jun 17, 2024
@bedevere-app
Copy link

bedevere-app bot commented Jun 17, 2024

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

@bedevere-app bedevere-app bot removed the needs backport to 3.12 only security fixes label Jun 17, 2024
@ferdnyc ferdnyc deleted the patch-1 branch June 17, 2024 13:22
mrahtz pushed a commit to mrahtz/cpython that referenced this pull request Jun 30, 2024
noahbkim pushed a commit to hudson-trading/cpython that referenced this pull request Jul 11, 2024
estyxx pushed a commit to estyxx/cpython that referenced this pull request Jul 17, 2024
@rhettinger rhettinger added the needs backport to 3.13 bugs and security fixes label Dec 16, 2024
@miss-islington-app
Copy link

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

@miss-islington-app
Copy link

Sorry, @ferdnyc and @rhettinger, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 79e09e60d865b7b3fcde9ccee86a502da82bb2b3 3.13

@rhettinger rhettinger removed the needs backport to 3.13 bugs and security fixes label Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir skip issue skip news

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants