[configTools] add __repr__ to Options mapping

print the default value only for brevity
This commit is contained in:
Cosimo Lupo 2022-04-19 18:09:50 +01:00
parent cc6b12582c
commit 5aa8986179

View File

@ -137,6 +137,16 @@ class Options(Mapping):
def __len__(self) -> int:
return self.__options.__len__()
def __repr__(self) -> str:
return (
f"{self.__class__.__name__}({{\n"
+ "".join(
f" {k!r}: Option(default={v.default!r}, ...),\n"
for k, v in self.__options.items()
)
+ "})"
)
_USE_GLOBAL_DEFAULT = object()