-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Printing of an empty UnitRange at the REPL lacks information #13966
Comments
+1 to also showing the compact form on the first line. After all, that's the only way to recreate the same object via copy/paste at the REPL. |
I really hate the new range printing. Anyone have a link to that discussion and PR handy? |
It was in the first post #13615 (the PR also links the julia-user discussions) |
That was me, in response to complaints that people wanted to see what's actually in the
Is there any issue with the colons being so close to each other? The standard summary usually has a colon, as does a |
I think we should print ranges the way we've always printed them. LinSpace can get special treatment. Ot we can just go back to returning an array, I'm really tired of complaints about this. |
Did you have something specific in mind about how to return an array and still convey A nice thing about
Is there a mechanism to have REPL options available for the user to set? The equivalent of "format long" in Matlab? REPL behavior can be highly personal, and it might be nice to offer a way for a person to choose, if it doesn't exist already. |
Printing |
@StefanKarpinski I think the |
How about leaving other ranges the way they were and just printing |
Wouldn't that be too inconsistent, only to reduce the surprise for users coming from MATLAB? The different treatment of |
The justification would seem to be that people are freaked out by one and unphased by the other. |
For reference here's the 0.4 behavior:
Here's the discussion that started this.Why not show more info like number of elements, element type, what's inside, etc.? |
fixed by #15799 |
An empty
UnitRange
holds more information than the fact that it's empty, this is used with e.g.searchsorted
to indicate the "insertion point". The following session leaves to be desired:Showing instead something like "0-element UnitRange{Int64} 2:1" would help. Actually, I would personally prefer that even a non-empty range is shown like this in compact form (before the list of its values).
I guess this was made in #13615, cc @artkuo .
The text was updated successfully, but these errors were encountered: