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

Small improvements to the itertools docs #123885

Merged
merged 4 commits into from
Sep 10, 2024

Conversation

rhettinger
Copy link
Contributor

@rhettinger rhettinger commented Sep 9, 2024

  • Document where islice() leaves the input iterator.
  • Document that nested tee() calls are flattened.
  • Improve the fidelity of the islice() and product() rough equivalents to show the error checking for negative inputs. This is needed because the rough equivalents use sequence multiplication which treats negative inputs the same as zero.

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

@rhettinger rhettinger added the docs Documentation in the Doc dir label Sep 9, 2024
@bedevere-app bedevere-app bot added awaiting core review tests Tests in the Lib/test dir labels Sep 9, 2024
@rhettinger rhettinger added needs backport to 3.12 bug and security fixes needs backport to 3.13 bugs and security fixes labels Sep 10, 2024
@rhettinger rhettinger merged commit 2afba5c into python:main Sep 10, 2024
44 checks passed
@miss-islington-app
Copy link

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

@rhettinger rhettinger deleted the itertool_doc_edits branch September 10, 2024 01:57
@miss-islington-app
Copy link

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

cherry_picker 2afba5ca6d27c69bc0a1618e86c2e4c00eefa4c1 3.13

@miss-islington-app
Copy link

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

cherry_picker 2afba5ca6d27c69bc0a1618e86c2e4c00eefa4c1 3.12

@bedevere-bot
Copy link

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

Hi! The buildbot aarch64 Fedora Stable Refleaks 3.x has failed when building commit 2afba5c.

What do you need to do:

  1. Don't panic.
  2. Check the 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/123/builds/29) and take a look at the build logs.
  4. Check if the failure is related to this commit (2afba5c) 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/123/builds/29

Failed tests:

  • test.test_multiprocessing_spawn.test_processes

Test leaking resources:

  • test_processes: references
  • test_processes: memory blocks

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

==

Click to see traceback logs
remote: Enumerating objects: 15, done.        
remote: Counting objects:   6% (1/15)        
remote: Counting objects:  13% (2/15)        
remote: Counting objects:  20% (3/15)        
remote: Counting objects:  26% (4/15)        
remote: Counting objects:  33% (5/15)        
remote: Counting objects:  40% (6/15)        
remote: Counting objects:  46% (7/15)        
remote: Counting objects:  53% (8/15)        
remote: Counting objects:  60% (9/15)        
remote: Counting objects:  66% (10/15)        
remote: Counting objects:  73% (11/15)        
remote: Counting objects:  80% (12/15)        
remote: Counting objects:  86% (13/15)        
remote: Counting objects:  93% (14/15)        
remote: Counting objects: 100% (15/15)        
remote: Counting objects: 100% (15/15), done.        
remote: Compressing objects:  16% (1/6)        
remote: Compressing objects:  33% (2/6)        
remote: Compressing objects:  50% (3/6)        
remote: Compressing objects:  66% (4/6)        
remote: Compressing objects:  83% (5/6)        
remote: Compressing objects: 100% (6/6)        
remote: Compressing objects: 100% (6/6), done.        
remote: Total 8 (delta 7), reused 2 (delta 2), pack-reused 0 (from 0)        
From https://github.com/python/cpython
 * branch                    main       -> FETCH_HEAD
Note: switching to '2afba5ca6d27c69bc0a1618e86c2e4c00eefa4c1'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do 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 false

HEAD is now at 2afba5ca6d2 Small improvements to the itertools docs (GH-123885)
Switched to and reset branch 'main'

configure: WARNING: no system libmpdecimal found; falling back to bundled libmpdecimal (deprecated and scheduled for removal in Python 3.15)

make: *** [Makefile:2275: buildbottest] Error 2

@bedevere-bot
Copy link

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

Hi! The buildbot PPC64LE RHEL8 Refleaks 3.x has failed when building commit 2afba5c.

What do you need to do:

  1. Don't panic.
  2. Check the 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/384/builds/1274) and take a look at the build logs.
  4. Check if the failure is related to this commit (2afba5c) 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/384/builds/1274

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

Click to see traceback logs
remote: Enumerating objects: 15, done.        
remote: Counting objects:   6% (1/15)        
remote: Counting objects:  13% (2/15)        
remote: Counting objects:  20% (3/15)        
remote: Counting objects:  26% (4/15)        
remote: Counting objects:  33% (5/15)        
remote: Counting objects:  40% (6/15)        
remote: Counting objects:  46% (7/15)        
remote: Counting objects:  53% (8/15)        
remote: Counting objects:  60% (9/15)        
remote: Counting objects:  66% (10/15)        
remote: Counting objects:  73% (11/15)        
remote: Counting objects:  80% (12/15)        
remote: Counting objects:  86% (13/15)        
remote: Counting objects:  93% (14/15)        
remote: Counting objects: 100% (15/15)        
remote: Counting objects: 100% (15/15), done.        
remote: Compressing objects:  20% (1/5)        
remote: Compressing objects:  40% (2/5)        
remote: Compressing objects:  60% (3/5)        
remote: Compressing objects:  80% (4/5)        
remote: Compressing objects: 100% (5/5)        
remote: Compressing objects: 100% (5/5), done.        
remote: Total 8 (delta 7), reused 4 (delta 3), pack-reused 0 (from 0)        
From https://github.com/python/cpython
 * branch                    main       -> FETCH_HEAD
Note: switching to '2afba5ca6d27c69bc0a1618e86c2e4c00eefa4c1'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do 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 false

HEAD is now at 2afba5ca6d2 Small improvements to the itertools docs (GH-123885)
Switched to and reset branch 'main'

configure: WARNING: no system libmpdecimal found; falling back to bundled libmpdecimal (deprecated and scheduled for removal in Python 3.15)

make: *** [Makefile:2305: buildbottest] Terminated

diegorusso pushed a commit to diegorusso/cpython that referenced this pull request Sep 10, 2024
@picnixz
Copy link
Contributor

picnixz commented Sep 11, 2024

@rhettinger Notifying you to remind you that the backports failed (my cherry-picker is dissident so I can't do it easily so someone else needs to do it).

rhettinger added a commit to rhettinger/cpython that referenced this pull request Oct 7, 2024
@bedevere-app
Copy link

bedevere-app bot commented Oct 7, 2024

GH-125075 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 Oct 7, 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 needs backport to 3.12 bug and security fixes skip issue skip news tests Tests in the Lib/test dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants