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

reverse(zip(its...)) now checks lengths of constituent iterators for equality #50435

Merged
merged 3 commits into from
Oct 26, 2023

Conversation

adienes
Copy link
Contributor

@adienes adienes commented Jul 6, 2023

fixes #45085, fixes #25583, as per suggested by @Moelf

Despite the fact that this might cause code to fail that previously worked, I think this is a bugfix not a breaking change.

In particular, Iterators.reverse says:

Given an iterator itr, then reverse(itr) is an iterator over the same collection but in the reverse order

And in many cases, the previous behavior of reverse(::Zip) would not return "the same collection"

@mschauer
Copy link
Contributor

mschauer commented Aug 7, 2023

I think _zip_lengths_finite_equal(is) deserves a doc string, in particular it is not clear what pair of Bool and Union{Nothing, Int} (?) the function is supposed to return .

base/iterators.jl Outdated Show resolved Hide resolved
@oscardssmith
Copy link
Member

@nanosoldier runtests()

@nanosoldier
Copy link
Collaborator

The package evaluation job you requested has completed - possible new issues were detected.
The full report is available.

@adienes
Copy link
Contributor Author

adienes commented Aug 15, 2023

looks pretty safe actually? among the packages that failed only on this branch,

GMT.jl
VCFTools.jl
Braket.jl
Test.jl

I did not see any use of reverse(zip in the source code and the failure logs did not contain the new error message in this PR, so I think it is unrelated.

I also did a code search on JuliaHub and I find use here

The latter two it appears, as far as I can tell, to be using the pattern safely and already ensuring that the lengths being zipped match. Only InteractiveCodeSearch.jl it looks like might sometimes (presumably unwittingly) be facing this bug, but I'm not at all familiar with the package so not sure what to do about it---it seems its tests passed at least

@adienes
Copy link
Contributor Author

adienes commented Sep 1, 2023

bump

@adienes
Copy link
Contributor Author

adienes commented Sep 14, 2023

bump
does this need triage? or is it unambiguously a bugfix

@adienes
Copy link
Contributor Author

adienes commented Oct 5, 2023

bump

@oscardssmith oscardssmith added the triage This should be discussed on a triage call label Oct 5, 2023
@oscardssmith
Copy link
Member

Throwing it on the triage label just in case (and to make sure it doesn't get forgotten) IMO it's a bugfix.

@adienes
Copy link
Contributor Author

adienes commented Oct 26, 2023

can we merge or close?

@oscardssmith oscardssmith merged commit 342d718 into JuliaLang:master Oct 26, 2023
2 checks passed
@oscardssmith oscardssmith removed the triage This should be discussed on a triage call label Oct 26, 2023
@oscardssmith
Copy link
Member

thanks for the reminder!

@adienes adienes mentioned this pull request Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix This change fixes an existing bug iteration Involves iteration or the iteration protocol
Projects
None yet
7 participants