remove mapreduce methods that don't take an iterator argument#54088
Merged
oscardssmith merged 1 commit intoJuliaLang:masterfrom Apr 26, 2024
Merged
remove mapreduce methods that don't take an iterator argument#54088oscardssmith merged 1 commit intoJuliaLang:masterfrom
mapreduce methods that don't take an iterator argument#54088oscardssmith merged 1 commit intoJuliaLang:masterfrom
Conversation
PR JuliaLang#52631 made `map` throw `MethodError` when called without an iterator argument. That made `mapreduce` throw `MethodError` when called without an iterator argument, too, something that was *not* noticed back then. This change makes iteratorless `mapreduce` throw before it can be called, instead of when it tries to call `map` (or `Generator`) without passing it an iterator argument. Now all of these functions should only have methods that take a positive number of iterator arguments, which improves consistency: 1. `map` 2. `Iterators.map` 3. `foreach` 4. `reduce` 5. `foldl` 6. `foldr` 7. `mapreduce` 8. `mapfoldl` 9. `mapfoldr` 10. `Base.Generator`
Member
Author
|
Should probably also update the NEWS entry for v1.11. Should I just open a PR to the |
Member
|
I like this PR for all the same reasons as #52631. The procedure for backporting is to make a PR to master and add a backport label. @nanosoldier |
Collaborator
|
The package evaluation job you requested has completed - possible new issues were detected. |
Member
|
PkgEval looks clean. Tagging triage because this is technically breaking, but I expect this to be an easy "yes". |
Member
|
Triage has no objection to this |
Member
Author
|
Is something missing here or is it good to go? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR #52631 made
mapthrowMethodErrorwhen called without an iterator argument. That mademapreducethrowMethodErrorwhen called without an iterator argument, too, something that was not noticed back then. This change makes iteratorlessmapreducethrow before it can be called, instead of when it tries to callmap(orGenerator) without passing it an iterator argument.Now all of these functions should only have methods that take a positive number of iterator arguments, which improves consistency:
mapIterators.mapforeachreducefoldlfoldrmapreducemapfoldlmapfoldrBase.Generator