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

map of Tuple and NamedTuple should return a Tuple or NamedTuple #33788

Open
rafaqz opened this issue Nov 8, 2019 · 1 comment
Open

map of Tuple and NamedTuple should return a Tuple or NamedTuple #33788

rafaqz opened this issue Nov 8, 2019 · 1 comment

Comments

@rafaqz
Copy link
Contributor

rafaqz commented Nov 8, 2019

Array is a strange return type for this interaction:

julia> map(+, (1, 2), (x=1, y=2))
2-element Array{Int64,1}:
 2
 4

Suddenly we have an allocating (and potentially unstable) type with different properties to a tuple. This produces undexpected and hard to find bugs.

The path of least surprise when using map on two objects with Tuple in their name would be to return some kind of Tuple.

Obviously this is a breaking change, so this is for 2.0.

@ederag
Copy link
Contributor

ederag commented May 17, 2021

Related, interesting discussion: #5794

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants