Use repr() to make quoted strings #1019

Merged
merged 3 commits into from Nov 20, 2011

Conversation

Projects
None yet
3 participants
@takluyver
Member

takluyver commented Nov 20, 2011

Should at least begin to fix #1009, by correctly escaping strings with \U or \u in them.

This only broke a few tests because repr defaults to 'single quotes', whereas our implementation defaulted to "double quotes". I've fixed those.

Bonus fix: a couple of config tests were failing on Python 3.

@rkern

This comment has been minimized.

Show comment
Hide comment
@rkern

rkern Nov 20, 2011

Contributor

Note that %r will do the repr() for you.

('%r' % value) == ('%s' % repr(value))
Contributor

rkern commented Nov 20, 2011

Note that %r will do the repr() for you.

('%r' % value) == ('%s' % repr(value))
@takluyver

This comment has been minimized.

Show comment
Hide comment
@takluyver

takluyver Nov 20, 2011

Member

Good point. Done.

Member

takluyver commented Nov 20, 2011

Good point. Done.

fperez added a commit that referenced this pull request Nov 20, 2011

Merge pull request #1019 from takluyver/repr-quotestring
Use repr() to make quoted strings.  This simplifies our quoting code by letting us rely on built-in capabilities of the language.

@fperez fperez merged commit 268ecbe into ipython:master Nov 20, 2011

@fperez

This comment has been minimized.

Show comment
Hide comment
@fperez

fperez Nov 20, 2011

Member

Thanks, looks great (and to @rkern for the review!). Merged.

Member

fperez commented Nov 20, 2011

Thanks, looks great (and to @rkern for the review!). Merged.

mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014

Merge pull request #1019 from takluyver/repr-quotestring
Use repr() to make quoted strings.  This simplifies our quoting code by letting us rely on built-in capabilities of the language.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment