Skip to main content

safe_repr

No overview available.

def safe_repr(
obj: Any
) - > string

Returns a string representation of an object that is guaranteed to be printable without raising exceptions. This is primarily used for logging or debugging where the object's own repr might be broken or unsafe.

Parameters

NameTypeDescription
objAnyThe object to be converted into a string representation.

Returns

TypeDescription
stringA string representation of the object, or a fallback string if the standard representation fails.