Skip to content

Commit 21550bc

Browse files
committed
Move position of comment in utils.head()
1 parent b9b45e7 commit 21550bc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

domdf_python_tools/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,10 +456,10 @@ def head(obj: Union[Tuple, List, "DataFrame", "Series", "String"], n: int = 10)
456456
"""
457457

458458
if isinstance(obj, tuple) and hasattr(obj, "_fields"):
459+
# Likely a namedtuple
459460
if len(obj) <= n:
460461
return repr(obj)
461462
else:
462-
# Likely a namedtuple
463463
head_of_namedtuple = {k: v for k, v in zip(obj._fields[:n], obj[:n])} # type: ignore
464464
repr_fmt = '(' + ', '.join(f'{k}={v!r}' for k, v in head_of_namedtuple.items()) + f', {etc})'
465465
return obj.__class__.__name__ + repr_fmt

0 commit comments

Comments
 (0)