You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The depth "folds" everything deeper than 1 level. Then if you lower the width of the output enough, what was once on one line, will now be split by newlines.
The bug is, if you lower the width below seven characters. Which is the length of [[...], It seems to override the depth parameter and print the everything with no folding. This is true of deeply nested structures too.
Expected behavior: for the folding ... to remain.
Why put the width so low?
I came across this because of the behavior of compact:
By default, if a data structure can fit on one line, it will be displayed on one line. compact only affects sequences that are longer than the given width.
**There is no way to force compact as False for short items**, so as to make sure all items, even short ones, appear on their own line.
[1,2,3] - will always appear on its own line, there is no way to make it appear like:
Activity
iansedano commentedon Oct 26, 2021
Reproducible example:
The depth "folds" everything deeper than 1 level. Then if you lower the width of the output enough, what was once on one line, will now be split by newlines.
The bug is, if you lower the width below seven characters. Which is the length of
[[...],It seems to override thedepthparameter and print the everything with no folding. This is true of deeply nested structures too.Expected behavior: for the folding
...to remain.Why put the width so low?
I came across this because of the behavior of
compact:By default, if a data structure can fit on one line, it will be displayed on one line.
compactonly affects sequences that are longer than the given width.**There is no way to force compact as False for short items**, so as to make sure all items, even short ones, appear on their own line.
[1,2,3] - will always appear on its own line, there is no way to make it appear like:
[1,
2,
3]
The only way is by setting a very low width.