Primary
__str__() ⚬|Documentation|1st|20260110182537-00-⌔
3. Data model — Python 3 documentation#object.str
object.__str__(self)Called by
str(object), the default__format__()implementation, and the built-in functionprint(), to compute the “informal” or nicely printable string representation of an object. The return value must be a str object.This method differs from
object.__repr__()in that there is no expectation that__str__()return a valid Python expression: a more convenient or concise representation can be used.The default implementation defined by the built-in type
objectcallsobject.__repr__().Printed 2026-06-28.
(echo:: @ ᯤ)
Link to original
Secondary
• • •