Skip to content

use Python 3-style for pretty-printed sets#3157

Merged
bfroehle merged 1 commit into
ipython:masterfrom
minrk:pretty-sets
Apr 10, 2013
Merged

use Python 3-style for pretty-printed sets#3157
bfroehle merged 1 commit into
ipython:masterfrom
minrk:pretty-sets

Conversation

@minrk
Copy link
Copy Markdown
Member

@minrk minrk commented Apr 10, 2013

Sets are now {1,2,3} instead of set([1,2,3]), matching repr(set) on Python 3.

This change applies Python 3-style to all Python versions.

closes #3156

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
bfroehle added a commit that referenced this pull request Apr 10, 2013
use Python 3-style for pretty-printed sets
@bfroehle bfroehle merged commit 33638b9 into ipython:master Apr 10, 2013
@takluyver
Copy link
Copy Markdown
Member

Ideally, though, the repr() for an empty set should be set(), not {}, since the latter evaluates to an empty dictionary. I don't know if that's easy to implement with the pretty-print framework.

@ivanov
Copy link
Copy Markdown
Member

ivanov commented Apr 12, 2013

this changeset "breaks" python2.6 compatibility - that may be worth noting somewhere...

@minrk
Copy link
Copy Markdown
Member Author

minrk commented Apr 12, 2013

@ivanov how does it break 2.6? It changes nothing but how sets are displayed (and @rkern finished up my hasty start here with more care in #3163)

@ivanov
Copy link
Copy Markdown
Member

ivanov commented Apr 12, 2013

well, i put "breaks" in quotes, since it's only that the {} syntax isn't supported for sets in 2.6. it's probably nothing...

@minrk
Copy link
Copy Markdown
Member Author

minrk commented Apr 13, 2013

but it's just pretty printing - I don't think there's any need for pretty-printed output to be eval-able.

@minrk minrk deleted the pretty-sets branch March 31, 2014 23:36
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014
use Python 3-style for pretty-printed sets
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.

update pretty to use Python 3 style for sets

4 participants