- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
array display is a mess #6117
Comments
Didn't a similar problem exist before Which is not to say that we shouldn't clean up the situation. One option would be to make Another would simply be to deprecate |
...or |
The purpose of |
See also #5709 |
Here's a possible way forward that deals with each of the extra parameters in
It is very helpful if the "pretty" output and the "useful" (e.g. parsable) output are the same. |
This also relates to #5564. |
I just happened upon this issue myself. I created a new abstract array type for which I specifically do not want to print the individual values. I had assumed that overloading Given that
Because
|
@mcg1969, that seems reasonable to me. |
I have found this problem when I was defining an
|
It's a mess, but it shouldn't be erroring. What's the definition of immutable ResidueCount{T, N, b} <: AbstractArray{T,N} |
We came across similar problems as to how to properly specialize the I think we need a specific page in the manual explaining how to create a new array type (e.g. what methods need to be defined, and what their behaviors are supposed to be, etc). |
Thanks @mbauman, I wasn't passing my parameters to |
Thanks for the pointer. But that part of the document does not mention |
Correct. |
see #14052 for latest cleanup plans for this |
Fixed by #16354. |
Recent changes to array printing have made it impossible to normally provide show methods for custom array types. The writemime function intercepts printing of arrays, so that if you define a new type, e.g.
Bytes <: AbstractVector{Uint8}
and then defineshow(io::IO, b::Bytes)
, that show method never gets called. This whole situation is a pretty huge mess, imo. There's no good reason for show and writemime for arrays to produce such different results and you certainly shouldn't have to know about or override writemime methods to get a custom array type to show up the way you want it to in the repl.The text was updated successfully, but these errors were encountered: