add a __repr__ for JobsArgument

This commit is contained in:
Anthony Sottile 2021-11-14 14:42:48 -08:00
parent b454674b27
commit 0698366a20
2 changed files with 10 additions and 0 deletions

View file

@ -80,6 +80,10 @@ class JobsArgument:
f"{arg!r} must be 'auto' or an integer.",
)
def __repr__(self) -> str:
"""Representation for debugging."""
return f"{type(self).__name__}({str(self)!r})"
def __str__(self):
"""Format our JobsArgument class."""
return "auto" if self.is_auto else str(self.n_jobs)