Repository navigation
BUG: linewidth was not respected for arrays other than 1d - #10175
Merged
Merged
Conversation
The available width needs to reduce by one for each dimension, to account for the trailing ] characters Fixes numpygh-10170
eric-wieser
commented
Dec 8, 2017
|
|
||
| for i in range(trailing_items, 1, -1): | ||
| word = recurser(index + (-i,), next_hanging_indent) | ||
| word = recurser(index + (-i,), next_hanging_indent, next_width) |
Member
Author
There was a problem hiding this comment.
Not strictly needed here, but in future this could be passed to the format function for printing, say, line-wrapped strings, or nested ndarrays.
eric-wieser
commented
Dec 8, 2017
|
|
||
| s += hanging_indent + recurser(index + (-1,), next_hanging_indent) | ||
| nested = recurser(index + (-1,), next_hanging_indent, next_width) | ||
| s += hanging_indent + nested |
Member
Author
There was a problem hiding this comment.
Lines were getting long...
eric-wieser
commented
Dec 8, 2017
| assert_equal(make_str(a, 7), '[11111\n' | ||
| ' 1]') | ||
| assert_equal(make_str(a, 5), '[111\n' | ||
| ' 111]') |
Member
|
LGTM |
Member
|
All right, I'm going to merge, Thanks Eric! |
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.
The available width needs to reduce by one for each dimension, to account for the trailing ] characters
Fixes gh-10170