We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a274579 commit f321ca3Copy full SHA for f321ca3
nibabel/volumeutils.py
@@ -338,12 +338,7 @@ def pretty_mapping(
338
if getterfunc is None:
339
getterfunc = getitem
340
mxlen = max(len(str(name)) for name in mapping)
341
- fmt = '%%-%ds : %%s' % mxlen
342
- out = []
343
- for name in mapping:
344
- value = getterfunc(mapping, name)
345
- out.append(fmt % (name, value))
346
- return '\n'.join(out)
+ return '\n'.join([f'{name:{mxlen}s} : {getterfunc(mapping, name)}' for name in mapping])
347
348
349
def make_dt_codes(codes_seqs: ty.Sequence[ty.Sequence]) -> Recoder:
0 commit comments