Delay flushing softspace until after cell finishes - #1662
Merged
Conversation
Fixes the behavior of print statements with trailing commas to suppress
new-lines:
In [1]: print 1,; print 2
1 2
Member
|
Since these are the only two calls to run_code, and neither one should flush softspace, why not just remove that call from run_code entirely, in favor of its new location in run_cell, rather than adding a new arg that should always be False? |
Contributor
Author
|
There does appear to be one other use of |
Member
|
Thanks! Looks good to me, then. The |
minrk
added a commit
that referenced
this pull request
Apr 26, 2012
move flushing softspace to run_cell from run_code called only once per cell closes #1512
mattvonrocketstein
pushed a commit
to mattvonrocketstein/ipython
that referenced
this pull request
Nov 3, 2014
move flushing softspace to run_cell from run_code called only once per cell closes ipython#1512
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Delay flushing softspace (i.e., printing a new line if
sys.stdout.softspaceis True) until after cell finishes executing.This changes the behavior from
to the more expected
Includes a test. Python 3 remove the notion of softspace, so the test limits itself to Python 2 only.
Closes #1512.