8000 BUG: Extra space is inserted on first line for long elements by eric-wieser · Pull Request #10182 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

BUG: Extra space is inserted on first line for long elements #10182

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

Merged
merged 1 commit into from
Dec 9, 2017

Conversation

eric-wieser
Copy link
Member

Fixes gh-10181

Also strip some trailing spaces added by the web editor in the release notes.

* For line-wrapping:

* The "dtype" part of ndarray reprs will now be printed on the next line
if there isn't space on the last line of array output.
* The ``linewidth`` format option is now always respected.
The `repr` or `str` of an array will never exceed this, unless a single
element is too wide.
* All but the last line of array strings will contain the same number of
elements.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is only a change in extremely contrived scenarios (custom separators), so probably doesn't belong here.

@eric-wieser eric-wieser changed the base branch from master to maintenance/1.14.x December 9, 2017 18:45
@charris
Copy link
Member
charris commented Dec 9, 2017

LGTM.

if len(line) + len(word) > line_width:
def _extendLine(s, line, word, line_width, next_line_prefix, legacy):
needs_wrap = len(line) + len(word) > line_width
if legacy != '1.13' and len(line) == len(next_line_prefix):
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose strictly this should be <=, but in practice that never happens

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure you don't want to change it before this goes in?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Guess I will. Updated

@charris charris merged commit 0cd292d into numpy:maintenance/1.14.x Dec 9, 2017
@charris
Copy link
Member
charris commented Dec 9, 2017

Thanks Eric.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0