-
-
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
Improve Set printing #7206
Improve Set printing #7206
Conversation
if length(S) > 10^7 | ||
A = copy!(Array(T, 1000), 1, S, 1, 1000) | ||
else | ||
A = sort!(T[x for x in S]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You probably want:
A = T[x for x in S]
method_exists(isless, (T, T)) && sort!(A)
See also showdict. It really feels like we should have a more general solution to pretty-printing collections. |
So does anything need doing here, or are you going scrap this and implement a general solution? |
Right now I don't see a clean way to implement a more general solution, unfortunately. |
This is at least better than what we have now, so I say we go for it now and work on a more general solution in #7959. |
6c7c7e3
to
1a4c02f
Compare
The more general cleanup is done, so a reduced subset of the Set is shown now. I don't think it's clear that we want to attempt to imply an arbitrary ordering on it (#7153). |
This solution was actually proposed by @stevengj on #7153
I'm just submitting it to get the ball rolling, or rolled.