@@ -325,8 +325,8 @@ def format_object_summary(
325
325
326
326
if indent_for_name :
327
327
name_len = len (name )
328
- space1 = " \n %s" % (" " * (name_len + 1 ))
329
- space2 = " \n %s" % (" " * (name_len + 2 ))
328
+ space1 = f' \n { (" " * (name_len + 1 ))} '
329
+ space2 = f' \n { (" " * (name_len + 2 ))} '
330
330
else :
331
331
space1 = "\n "
332
332
space2 = "\n " # space for the opening '['
@@ -363,14 +363,14 @@ def best_len(values):
363
363
close = ", "
364
364
365
365
if n == 0 :
366
- summary = "[]{}" . format ( close )
366
+ summary = f "[]{ close } "
367
367
elif n == 1 and not line_break_each_value :
368
368
first = formatter (obj [0 ])
369
- summary = "[{}]{}" . format ( first , close )
369
+ summary = f "[{ first } ]{ close } "
370
370
elif n == 2 and not line_break_each_value :
371
371
first = formatter (obj [0 ])
372
372
last = formatter (obj [- 1 ])
373
- summary = "[{}, {}]{}" . format ( first , last , close )
373
+ summary = f "[{ first } , { last } ]{ close } "
374
374
else :
375
375
376
376
if n > max_seq_items :
@@ -516,7 +516,7 @@ def format_object_attrs(
516
516
attrs : List [Tuple [str , Union [str , int ]]] = []
517
517
if hasattr (obj , "dtype" ) and include_dtype :
518
518
# error: "Sequence[Any]" has no attribute "dtype"
519
- attrs .append (("dtype" , "'{}'" . format ( obj .dtype ) )) # type: ignore
519
+ attrs .append (("dtype" , f "'{ obj .dtype } '" )) # type: ignore
520
520
if getattr (obj , "name" , None ) is not None :
521
521
# error: "Sequence[Any]" has no attribute "name"
522
522
attrs .append (("name" , default_pprint (obj .name ))) # type: ignore
0 commit comments