Skip to content

Change cat to use dims keyword arguments #27100

Closed
@Keno

Description

@Keno

It was pointed out that cat wasn't included in the recent refactor to make
dimensionality a keyword argument. cat is a bit different than the other such
functions in that it is often called with only a single dimension, but the argument does
generalize:

julia> cat(1, 2, 3, 4)
3-element Array{Int64,1}:
 2
 3
 4

julia> cat((1,2), 2, 3, 4)
3×3 Array{Int64,2}:
 2  0  0
 0  3  0
 0  0  4

Given those, examples, I think it would be nice to explicitly call out which argument is the dimension, e.g.:

cat(2, 3, 4; dims = 1)

There's a question what the default should be if no argument is passed. For now, we can't really do anything abut that because of the deprecation (so we should make calls that don't match the deprecation and don't have the keyword arg an error), but it may be nice to eventually do something automatic based on the argument types.

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedIndicates that a maintainer wants help on an issue or pull request

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions