-
-
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
remove length from Stateful #51747
remove length from Stateful #51747
Conversation
As you state you're removing:
and thus:
and I'm thinking, is this a "breaking" change? I think you're right, and this would be an "improvement" in some sense, but you would get an ERROR at runtime (e.g. in packages)? Instead of what, misleading or wrong answers... with status quo? I'm conflicted here, because of the principle (of not removing/changing/semver) vs. better API. I'm all for trying this on master (for 1.11), what do do for 1.10? Deprecate this and NOT remove? If relying on this function is a technically breaking change, i.e. a bug, (almost) always, then change this in some way on 1.10, i.e. backport soon? Would it help to deprecate and do something like I suppose PkgEval should be run with this simply removed to see potential practical consequences, but even if none turn up, it wouldn't rule out breaking user code. So what's best to do for 1.10? |
This will not be backported to 1.10, it's too late for that kind of changes. I can't help but feel that the fix here is a bandaid over a larger problem, namely that Julia does not have any functionality to distinguish mutable from immutable iterators, and as a result of that, consistently conflate them even in Base. However, this is a rather fundamental problem, and as such, is unlikely to be fixed. So solutions like the ones here may be the best approach. |
@PallHaraldsson You keep commenting in various PRs (that have semi-breaking or invasive changes) about backporting them to 1.10 and every time it has to be pointed out that 1.10 is not in that stage. At this point, I would maybe stop worrying so much about 1.10 and just assume that the backports will be handled in an ok way. |
Should we at least add a "breaking" label? I think we should take breaking changes seriously, why I bring this up more than 1.10. |
Stateful iterators do not have a consistent notion of length, as it is continuously changing as elements are removed. As the main purpose of Stateful is to take elements from multiple places, any notion of HaveShape is invalid for those cases, and thus not useful in general. Fix #47790
fef0b07
to
ff81cf5
Compare
triage says this is a (slightly breaking) bugfix. |
@nanosoldier |
|
Mea culpa, thanks for the PR to fix my usage of this Jameson. |
@nanosoldier |
Your job failed. |
CI isn't happy and there are some open questions so switching labels here |
@nanosoldier |
Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. |
Turns out this is kinda breaking |
That's right. However, status quo (before this PR) have wrong answers in several cases. I would argue that breaking code is better than having it silently be wrong. |
The problem is where In DiskArrays.jl we will have to make our own identical |
Yeah, I can see that use, but it is only fine because you are relying on it being a monotonic counter to see if the iterator has advanced, and not actually using it as a |
All cases so far of |
Stateful iterators do not have a consistent notion of length, as it is continuously changing as elements are removed. As the main purpose of Stateful is to take elements from multiple places, any notion of HaveShape is invalid for those cases, and thus not useful in general.
Fix #47790
Blocked on #51869