summaryrefslogtreecommitdiff
path: root/numpy/core/arrayprint.py
diff options
context:
space:
mode:
authorPan Jan <rumcajsgajos@gmail.com>2020-04-27 13:22:14 +0200
committerPan Jan <rumcajsgajos@gmail.com>2020-04-27 13:37:22 +0200
commit58b4027ef73866f3e16c91f9ab707b33c9a3fba9 (patch)
tree580283f105a70eaf1fba3c9ea7a1c5a395709c02 /numpy/core/arrayprint.py
parenta95aae3acac02e9c8b17e9cb3e460c26e2eba0ae (diff)
downloadnumpy-58b4027ef73866f3e16c91f9ab707b33c9a3fba9.tar.gz
Make requested changes
Diffstat (limited to 'numpy/core/arrayprint.py')
-rw-r--r--numpy/core/arrayprint.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/numpy/core/arrayprint.py b/numpy/core/arrayprint.py
index 0f3e5ea5c..5d9642ea8 100644
--- a/numpy/core/arrayprint.py
+++ b/numpy/core/arrayprint.py
@@ -714,22 +714,21 @@ def _extendLine_pretty(s, line, word, line_width, next_line_prefix, legacy):
if len(words) == 1 or legacy == '1.13':
return _extendLine(s, line, word, line_width, next_line_prefix, legacy)
- line_length = len(line)
max_word_length = max(len(word) for word in words)
- if line_length + max_word_length > line_width and \
- len(line) > len(next_line_prefix):
+ if (len(line) + max_word_length > line_width and
+ len(line) > len(next_line_prefix)):
s += line.rstrip() + '\n'
line = next_line_prefix + words[0]
indent = next_line_prefix
else:
+ indent = len(line)*' '
line += words[0]
- indent = line_length*' '
for word in words[1::]:
s += line.rstrip() + '\n'
line = indent + word
- suffix_length = max_word_length-len(words[-1])
+ suffix_length = max_word_length - len(words[-1])
line += suffix_length*' '
return s, line