From de016ea3494337197b22cf35d333a94137ca816f Mon Sep 17 00:00:00 2001 From: Andreas Poehlmann Date: Sat, 10 Feb 2024 15:43:38 +0100 Subject: [PATCH] upath._stat: add repr to UPathStatResult --- upath/_stat.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/upath/_stat.py b/upath/_stat.py index 06ab85d..3a6ec78 100644 --- a/upath/_stat.py +++ b/upath/_stat.py @@ -135,6 +135,11 @@ def __init__( self._seq = seq[: self.n_sequence_fields] self._info = info_dict or {} + def __repr__(self): + cls_name = type(self).__name__ + seq_attrs = ", ".join(map("{0[0]}={0[1]}".format, zip(self._fields, self))) + return f"{cls_name}({seq_attrs}, info={self._info!r})" + # --- access to the fsspec info dict ------------------------------ @classmethod