Quotes About Str
Technically, __str__ is preferred by print and str, and __repr__ is used as a fallback for these roles and in all other contexts.
~ Unknown
BazillionQuotes.com
Design note: as we'll learn in Chapter 30, the __repr__ method is often used to provide an as-code low-level display of an object when present, and __str__ is reserved for more user-friendly informational displays like ours here.
~ Unknown
BazillionQuotes.com
Because printing runs __str__ and the interactive prompt echoes results with __repr__, this can provide both target audiences with an appropriate display.
~ Unknown
BazillionQuotes.com
