-
-
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
last
now broken for custom iterators on master
#43101
Comments
Relevant usercode: https://github.com/Nemocas/Nemo.jl/blob/a35f2a5a6fc5f5a9455ef85af8020afb1b8c8b2f/src/gaussiannumbers/continued_fraction.jl#L353-L393 This interaction only worked because you've also defined Still, I can see how it's technically breaking behavior - cc @MasonProtter |
A possible fixed proposed, by marking it an explicit AbstractVector subtype. Previously, it was defined as |
Hm, sure there was an "undocumented dependence", but does that mean unless a function explicitly states which function it will call or which interface the objects should satisfy, it can not be relied upon? Which functions are supposed to keep working between minor version bumps? I would like to avoid this in the future, but it is not yet clear to me how. Edit: I understand that I can easily fix it. It is more a question of old versions now being broken between different julia (minor) versions, although no "unsafe" things were done. |
I don't know, I just think that |
That characterization of the problem is right, but in the absence of a general solution we need to (1) make good guesses about what methods might be implemented, and (2) try not to break things. My view is that iteration is inherently sequential, so |
Couldn't we solve this by making the default method for iterating |
Yeah that sounds promising. |
#42991 was indeed a breaking change because it changed the specification. Whenever you edit the docstring, you change the API. Unless you can show that the new version is a superset of the old version, it is breaking. Implementing the default |
On 1.0 - 1.7, the following is working
On recent master, due to #42943, this is broken and we have the following regression:
It does not really matter what the type here is. It is a custom iterator satisfying the iterator interface.
Why was
last
broken for iterators? I thought we are not breaking user code (which does not rely on internals) before 2.0 :)The text was updated successfully, but these errors were encountered: