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

fix #30643, correctly propagate iterator traits through Stateful #30644

Merged
merged 4 commits into from
Jan 9, 2019

Conversation

denizyuret
Copy link
Contributor

Not sure what the previous definition of IteratorSize was trying to do, but it was wrong for IsInfinite. Not sure what the correct answer is for HasShape.

Not sure what the previous definition of IteratorSize was trying to do, but it was wrong for IsInfinite. Not sure what the correct answer is for HasShape.
@ararslan ararslan added the needs tests Unit tests are required for this change label Jan 8, 2019
@StefanKarpinski StefanKarpinski requested review from Keno, nalimilan, StefanKarpinski and JeffBezanson and removed request for Keno and StefanKarpinski January 8, 2019 14:46
@StefanKarpinski
Copy link
Member

Anyone have a good test case for this?

@denizyuret
Copy link
Contributor Author

denizyuret commented Jan 8, 2019 via email

@JeffBezanson
Copy link
Member

Could you add that test to test/iterators.jl?

@@ -1089,10 +1089,9 @@ end

@inline peek(s::Stateful, sentinel=nothing) = s.nextvalstate !== nothing ? s.nextvalstate[1] : sentinel
@inline iterate(s::Stateful, state=nothing) = s.nextvalstate === nothing ? nothing : (popfirst!(s), nothing)
IteratorSize(::Type{Stateful{VS,T}} where VS) where {T} =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't quite remember what the intent here was, but it may have been to filter out HasSize, since we don't pass that through (and can't really support).

@denizyuret
Copy link
Contributor Author

denizyuret commented Jan 8, 2019 via email

@Keno
Copy link
Member

Keno commented Jan 8, 2019

Yeah, I think that's right.

@mbauman mbauman changed the title fixing #30643 fix #30643, correctly propagate iterator traits through Stateful Jan 8, 2019
@mbauman mbauman added the iteration Involves iteration or the iteration protocol label Jan 8, 2019
@JeffBezanson JeffBezanson merged commit 21dfef3 into JuliaLang:master Jan 9, 2019
@KristofferC KristofferC removed the needs tests Unit tests are required for this change label Jan 10, 2019
@KristofferC
Copy link
Member

Should be backported?

@JeffBezanson
Copy link
Member

Yes.

@StefanKarpinski StefanKarpinski added the bugfix This change fixes an existing bug label Jan 10, 2019
@KristofferC KristofferC mentioned this pull request Jan 11, 2019
53 tasks
KristofferC pushed a commit that referenced this pull request Jan 11, 2019
@StefanKarpinski StefanKarpinski added triage This should be discussed on a triage call backport 1.1 labels Jan 31, 2019
@StefanKarpinski StefanKarpinski added backport 1.0 triage This should be discussed on a triage call and removed backport 1.0 triage This should be discussed on a triage call labels Jan 31, 2019
@KristofferC KristofferC mentioned this pull request Feb 4, 2019
39 tasks
KristofferC pushed a commit that referenced this pull request Feb 11, 2019
@KristofferC KristofferC mentioned this pull request Feb 11, 2019
39 tasks
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
Development

Successfully merging this pull request may close these issues.

7 participants