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

update pretty to use Python 3 style for sets #3156

Closed
minrk opened this issue Apr 10, 2013 · 3 comments · Fixed by #3157 or #3163
Closed

update pretty to use Python 3 style for sets #3156

minrk opened this issue Apr 10, 2013 · 3 comments · Fixed by #3157 or #3163
Milestone

Comments

@minrk
Copy link
Member

minrk commented Apr 10, 2013

In Python 3, repr(set([1,2,3])) is {1,2,3}, but pretty currently forces the output to be set([1,2,3]). We should probably use the set-literal format on Python 3, or just use it all the time.

@bfroehle
Copy link
Contributor

The {1,2,3} syntax is supported in Python 2.7, so I'm in favor of using it always.

@minrk minrk closed this as completed in 3ed989c Apr 10, 2013
@rkern
Copy link
Contributor

rkern commented Apr 10, 2013

You should also change frozenset([]) to frozenset({}) while you're at it.

@minrk
Copy link
Member Author

minrk commented Jun 19, 2013

re-closed by #3163

@minrk minrk closed this as completed Jun 19, 2013
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014
Sets are now `{1,2,3}` instead of `set([1,2,3])`,
matching repr(set) on Python 3.

This change applies to all Python versions.

closes ipython#3156
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants