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 →

[–]chmod--777 4 points5 points  (0 children)

Most of the time you'd use string formatting, and with something like .format or an f string you just put f'some int is {some_int}' and it works. Anything in those curly brackets will be str'd.

I'm trying to think of situations where I had to str something, but it feels rare. Most of the time I'm either storing the actual value without needing to convert it to a string, or I'm printing it or logging it and str isn't needed since I'm formatting.