@@ -310,11 +310,12 @@ def format_object_summary(obj, formatter, is_justify=True, name=None,
310
310
space2 = "\n " # space for the opening '['
311
311
312
312
n = len (obj )
313
- if not line_break_each_value :
314
- sep = ','
313
+ if line_break_each_value :
314
+ # If we want to vertically align on each value of obj, we need to
315
+ # separate values by a line break and indent the values
316
+ sep = ',\n ' + ' ' * len (name )
315
317
else :
316
- # If we want to align on each value, we need a different separator.
317
- sep = (',\n ' + ' ' * len (name ))
318
+ sep = ','
318
319
max_seq_items = get_option ('display.max_seq_items' ) or n
319
320
320
321
# are we a truncated display
@@ -477,6 +478,8 @@ def format_object_attrs(obj):
477
478
attrs .append (('dtype' , "'{}'" .format (obj .dtype )))
478
479
if getattr (obj , 'name' , None ) is not None :
479
480
attrs .append (('name' , default_pprint (obj .name )))
481
+ elif getattr (obj , 'names' , None ) is not None and any (obj .names ):
482
+ attrs .append (('names' , default_pprint (obj .names )))
480
483
max_seq_items = get_option ('display.max_seq_items' ) or len (obj )
481
484
if len (obj ) > max_seq_items :
482
485
attrs .append (('length' , len (obj )))
0 commit comments