@@ -136,15 +136,11 @@ def __str__(self) -> str:
136136 visited .add (id (value ))
137137
138138 if isinstance (value , list ):
139- truncated_list = value [:list_max_len ] + (
140- ["…" ] if len (value ) > list_max_len else []
141- )
139+ truncated_list = value [:list_max_len ] + (["…" ] if len (value ) > list_max_len else [])
142140 return (
143141 "["
144142 + ", " .join (
145- abbrev_obj (
146- item , field_max_len , list_max_len , key_filter , value_filter , visited
147- )
143+ abbrev_obj (item , field_max_len , list_max_len , key_filter , value_filter , visited )
148144 for item in truncated_list
149145 )
150146 + "]"
@@ -161,11 +157,7 @@ def __str__(self) -> str:
161157 )
162158
163159 if isinstance (value , dict ):
164- return (
165- "{"
166- + _format_kvs (value .items (), field_max_len , key_filter , value_filter )
167- + "}"
168- )
160+ return "{" + _format_kvs (value .items (), field_max_len , key_filter , value_filter ) + "}"
169161
170162 if isinstance (value , Enum ):
171163 return value .name
@@ -190,10 +182,7 @@ def abbrev_on_words(text: str, max_len: int = 64, indicator: str = "…") -> str
190182 if words and max_len and len (words [0 ]) > max_len :
191183 return abbrev_str (words [0 ], max_len , indicator )
192184
193- while (
194- words
195- and len (_trim_trailing_punctuation (" " .join (words ))) + len (indicator ) > max_len
196- ):
185+ while words and len (_trim_trailing_punctuation (" " .join (words ))) + len (indicator ) > max_len :
197186 words .pop ()
198187
199188 return _trim_trailing_punctuation (" " .join (words )) + indicator
@@ -225,10 +214,7 @@ def abbrev_phrase_in_middle(
225214 # Walk through the split words, and tally total number of chars as we go.
226215 for i in range (len (words )):
227216 words [i ] = abbrev_str (words [i ], max_len , ellipsis )
228- if (
229- prefix_tally + len (words [i ]) + len (ellipsis ) + max_trailing_len >= max_len
230- and i > 0
231- ):
217+ if prefix_tally + len (words [i ]) + len (ellipsis ) + max_trailing_len >= max_len and i > 0 :
232218 prefix_end_index = i
233219 break
234220 prefix_tally += len (words [i ]) + 1
@@ -290,9 +276,7 @@ def fmt_age(since_time: float | timedelta, brief: bool = False) -> str:
290276 suppress = []
291277 min_unit = "years"
292278
293- age = precisedelta (
294- seconds , minimum_unit = min_unit , suppress = suppress , format = "%0.0f"
295- )
279+ age = precisedelta (seconds , minimum_unit = min_unit , suppress = suppress , format = "%0.0f" )
296280 if brief :
297281 age = (
298282 age .replace (" seconds" , "s" )
0 commit comments