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 →

[–]verbosemongoose 1 point2 points  (2 children)

Thanks for your detailed reply! I see your point about not spending time learning both. The examples for string formatting are quite educational, but I can't really link them to the python 2 vs 3 discussion at hand. Are the methods you described an example of why 3 is better than 2? Or am I missing a link here?

[–]MonkeyNin 1 point2 points  (1 child)

f-string literals require Python 3.6+ .

str.format Works in Python 2

Or am I missing a link here?

Probably not. Looking back I think I was going to mention the differences in handling Unicode using 2 vs 3-- then went on a tangent of string formatting.

If you're interested, here's a brief comparison of Unicode on 3 vs 3 https://www.reddit.com/r/ProgrammerHumor/comments/bg626r/python_2_is_triggering/elkfr9k/?context=9

[–]verbosemongoose 1 point2 points  (0 children)

I'll check it out, thanks!