-
-
Notifications
You must be signed in to change notification settings - Fork 33.4k
Fix docstring and var name of itertools recipe #112113
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
Conversation
`prepend()` works with arbitrary iterables, not only iterators. In fact, the example given uses a `list`, which is iterable, but not an iterator.
|
(Considering this is a trivial fix, I don't think this needs an issue, but I can open one if requested.) |
|
While it is true that any iterable will suffice, the intent and principal use case is for prepending a value to an iterator stream. Switching the variable name to So, I'm going to leave this as-is. The code is not wrong and the choice of parameter name can be anything that is useful. For someone writing type annotations, they can and should use |
|
After more thought, I think this edit is fine. |
`prepend()` works with arbitrary iterables, not only iterators. In fact, the example given uses a `list`, which is iterable, but not an iterator. (cherry picked from commit 6c47eac) Co-authored-by: Sebastian Rittau <[email protected]>
|
GH-112310 is a backport of this pull request to the 3.12 branch. |
`prepend()` works with arbitrary iterables, not only iterators. In fact, the example given uses a `list`, which is iterable, but not an iterator. (cherry picked from commit 6c47eac) Co-authored-by: Sebastian Rittau <[email protected]>
|
GH-112311 is a backport of this pull request to the 3.11 branch. |
…12311) Fix docstring and var name of itertools recipe (GH-112113) `prepend()` works with arbitrary iterables, not only iterators. In fact, the example given uses a `list`, which is iterable, but not an iterator. (cherry picked from commit 6c47eac) Co-authored-by: Sebastian Rittau <[email protected]>
…12310) Fix docstring and var name of itertools recipe (GH-112113) `prepend()` works with arbitrary iterables, not only iterators. In fact, the example given uses a `list`, which is iterable, but not an iterator. (cherry picked from commit 6c47eac) Co-authored-by: Sebastian Rittau <[email protected]>
`prepend()` works with arbitrary iterables, not only iterators. In fact, the example given uses a `list`, which is iterable, but not an iterator.
`prepend()` works with arbitrary iterables, not only iterators. In fact, the example given uses a `list`, which is iterable, but not an iterator.
prepend()works with arbitrary iterables, not only iterators. In fact, the example given uses alist, which is iterable, but not an iterator.Spotted by @AlexWaygood in python/typeshed#10992.
📚 Documentation preview 📚: https://cpython-previews--112113.org.readthedocs.build/