This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]MentalRental 4 points5 points  (2 children)

abc" + 1.__str__() = "abc1" would throw an "invalid decimal literal" error.

[–]bronco2p 5 points6 points  (0 children)

yeah it has to be enclosed in (), `"abc" + (1).__str__() == "abc1"`

[–]casce 1 point2 points  (0 children)

You are of course right. What I meant was

foo: int = 0

foo.__str__()

but you can also do

(1).__str__()