We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
the default of a trace does not appear in the string representation. Could adapt str with
def __str__(self): """A human-readable string representation (truncated if it gets too long). """ def format_item(item): return "{!s}: {!s}".format(*item) MAX_LENGTH = 20 half = MAX_LENGTH // 2 if len(self) > MAX_LENGTH: one = ", ".join(format_item(_) for _ in self._d.items()[:half]) two = ", ".join(format_item(_) for _ in self._d.items()[half:-half]) three = ", ".join(format_item(_) for _ in self._d.items()[-half:]) truncate_string = f"<...{len(self) - MAX_LENGTH} items...>" if len(truncate_string) < len(two): two = truncate_string items = ", ".join([one, two, three]) else: items = ", ".join(format_item(_) for _ in self._d.items()) default = f", default={self.default!r}".format(self.default) if self.default else "" return f"{type(self).__name__}({{{items}}}{default})"
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
the default of a trace does not appear in the string representation.
Could adapt str with
The text was updated successfully, but these errors were encountered: