Skip to content

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

@rafaqz

Description

@rafaqz

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    breakingThis change will break codecollectionsData structures holding multiple items, e.g. sets

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions