-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Stateful Iterator omitting last element when used in list comprehension, crashes on 1-element long vectors. #35530
Comments
cc @Keno since IIRC, you implemented the Stateful iterator |
That looks like a bug in |
I came to a similar conclusion in https://discourse.julialang.org/t/strange-behavior-with-list-comprehensions-using-iterators-stateful/29715/2 |
Ah yes, should have read that first... |
I think I just hit this:
This produces
|
I have "fixed" it by adding this:
It makes my eyes bleed a bit to have to include this in my script though. Although it feels like a plaster over a compound fracture, perhaps it is one approach to fixing this in core? |
Previously this code would drop 1 from the length of some generators. Fixes #35530
Previously this code would drop 1 from the length of some generators. Fixes JuliaLang#35530
Previously this code would drop 1 from the length of some generators. Fixes JuliaLang#35530
Strage behaviour of Stateful iterator:
Although
works as it should,
With list comprehension it fails to iterate over last element
tried on Julia 1.3.1, Julia 1.4.0 and Julia 1.4.1.
More details in https://discourse.julialang.org/t/strange-behavior-with-list-comprehensions-using-iterators-stateful/29715
The text was updated successfully, but these errors were encountered: