You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Object of user-defined classes that implement a string representation function (str or repr) have this string representation used in the rendering of the object. However, newlines are replaced by spacrs and leading/trailing whitespace characters are stripped from this string representation. This gives an unnatural look to objects with a multiline string representation with leading/trailing whitespace. For example, an object with a string representation that looks like
pdawyndt
changed the title
Multiline string representation of custom objects
Python Tutor: multiline string representation of custom objects
May 28, 2024
Object of user-defined classes that implement a string representation function (
str
orrepr
) have this string representation used in the rendering of the object. However, newlines are replaced by spacrs and leading/trailing whitespace characters are stripped from this string representation. This gives an unnatural look to objects with a multiline string representation with leading/trailing whitespace. For example, an object with a string representation that looks likeis now rendered as
Example: https://dodona.be/nl/submissions/18102857/
Would be more natural to show the original (multiline) string representation for the object.
The text was updated successfully, but these errors were encountered: