@@ -306,11 +306,12 @@ def format_object_summary(obj, formatter, is_justify=True,
306
306
space2 = "\n %s" % (' ' * (len (name ) + 2 ))
307
307
308
308
n = len (obj )
309
- if not line_break_each_value :
310
- sep = ','
309
+ if line_break_each_value :
310
+ # If we want to vertically align on each value of obj, we need to
311
+ # separate values by a line break and indent the values
312
+ sep = ',\n ' + ' ' * len (name )
311
313
else :
312
- # If we want to align on each value, we need a different separator.
313
- sep = (',\n ' + ' ' * len (name ))
314
+ sep = ','
314
315
max_seq_items = get_option ('display.max_seq_items' ) or n
315
316
316
317
# are we a truncated display
@@ -467,6 +468,8 @@ def format_object_attrs(obj):
467
468
attrs .append (('dtype' , "'{}'" .format (obj .dtype )))
468
469
if getattr (obj , 'name' , None ) is not None :
469
470
attrs .append (('name' , default_pprint (obj .name )))
471
+ elif getattr (obj , 'names' , None ) is not None and any (obj .names ):
472
+ attrs .append (('names' , default_pprint (obj .names )))
470
473
max_seq_items = get_option ('display.max_seq_items' ) or len (obj )
471
474
if len (obj ) > max_seq_items :
472
475
attrs .append (('length' , len (obj )))
0 commit comments