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

Improve Set printing #7206

Closed
wants to merge 3 commits into from
Closed

Conversation

samuelcolvin
Copy link
Contributor

This solution was actually proposed by @stevengj on #7153

I'm just submitting it to get the ball rolling, or rolled.

if length(S) > 10^7
A = copy!(Array(T, 1000), 1, S, 1, 1000)
else
A = sort!(T[x for x in S])
Copy link
Member

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)

@stevengj
Copy link
Member

See also showdict. It really feels like we should have a more general solution to pretty-printing collections.

@samuelcolvin
Copy link
Contributor Author

So does anything need doing here, or are you going scrap this and implement a general solution?

@stevengj
Copy link
Member

Right now I don't see a clean way to implement a more general solution, unfortunately.

@quinnj
Copy link
Member

quinnj commented Aug 19, 2014

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.

@vtjnash
Copy link
Sponsor Member

vtjnash commented Jun 26, 2019

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).

@vtjnash vtjnash closed this Jun 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants