3 ms·
Not the op but Im guessing just using + (which calls .__str__(), iirc?)
by nothrabannosir 11y ago
Not the op but Im guessing just using + (which calls .__str__(), iirc?)
- richardwhiuk 11y ago+ doesn't call __str__ internally. e.g the following is an error. a = 4 "a: " + a You have to do: "a: " + str(a)
- barely_stubbell 11y agoI agree that + is likely the 4th way. A minor correction to your comment: "+" calls the __add__ method (big surprise) - just fyi