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

Empty multidimensional arrays have empty compact representation #19840

Closed
GunnarFarneback opened this issue Jan 3, 2017 · 1 comment
Closed
Labels
arrays [a, r, r, a, y, s] display and printing Aesthetics and correctness of printed representations of objects.

Comments

@GunnarFarneback
Copy link
Contributor

Empty matrices disappear when displayed as part of something else. Maybe not completely illogical but kind of confusing.

julia> [zeros(0, 0)]
1-element Array{Array{Float64,2},1}:
 

julia> type T
           a::Matrix{Float64}
           b::Matrix{Float64}
       end

julia> T(zeros(0, 0), zeros(0, 0))
T(,)
@nalimilan
Copy link
Member

Sounds weird indeed. Reduced reproducer:

julia> showcompact(zeros(0))
Float64[]
julia> showcompact(zeros(0, 0))

julia> showcompact(zeros(0, 0, 0))

I guess we should print Array{Float64,2}(), Array{Float64,3}(), etc.

@nalimilan nalimilan changed the title Disappearing empty matrices Empty multidimensional arrays have empty compact representation Jan 3, 2017
@kshyatt kshyatt added the arrays [a, r, r, a, y, s] label Jan 3, 2017
@JeffBezanson JeffBezanson added the display and printing Aesthetics and correctness of printed representations of objects. label Jan 3, 2017
stevengj added a commit to stevengj/julia that referenced this issue Jan 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrays [a, r, r, a, y, s] display and printing Aesthetics and correctness of printed representations of objects.
Projects
None yet
Development

No branches or pull requests

4 participants