Converts any value to a stripped string, returning a default if empty. Ensures consistent string output for reporting.
def stringify(value: Any, default: str = "") -> str:
"""Convert a value to a stripped string.
Args:
value: Value to convert.
default: Fallback returned when the converted string is empty.
Returns:
The stripped string representation, or ``default``.
"""
return _stringify_impl(value, default)
See the full source, get the GitHub permalink, and search 40K more like it.
Get a free API key