-
-
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
Tuple constructor change from 0.5 to 0.6 #20969
Comments
@yuyichao could you let me know how to fix this? |
Well, you didn't define the constructor so define it if you want it. |
Apparently |
I think the new Tuple constructors could probably be methods of |
Hmm, on second thought I guess it didn't seem like a good idea to allow |
@JeffBezanson thanks. Does that mean that |
When to define |
FWIW I also ran into this ref: https://discourse.julialang.org/t/tuple-constructor-on-0-6-with-convert/2358 |
@musm - thanks. I'm going to close this out, I guess, since it looks like it was deliberate. I'd really prefer "one way to do it" and not have to worry about judgement calls, but I understand that's not always possible. I'll default to explicit constructors, which means importing/extending |
It's interesting to think about merging The other, lesser, issue, is the potential for surprises or performance traps when an expensive "conversion" happens. It makes sense to be able to construct a Tuple from a generator, say, but do we want to be able to store a generator into an array of tuples and have it converted? Some of those cases can be addressed by separate functions, like |
I think the general problem with idempotent constructors is with containers that nest. You can create a
|
Unfortunately lots of container constructors already are idempotent. For example |
I guess we could require |
Isn't that fortunate if you want to move towards expecting all constructors to be idempotent? |
Yes, I meant unfortunate for SVectors, not anybody else :) |
0.5:
0.6:
Not sure whether I missed something in NEWS again, but here we are.
The text was updated successfully, but these errors were encountered: