Live data from Hacker News

Python string literals are kinda funny

sebsite.pw

11–20 of 54 posts

Re: Python string literals are kinda funny

#12
post #7
post #5

I'm not a fan of f-strings. I feel like 90% of new Python features in the last 10 years just increased language complexity without any benefit.

Indeed, and I get that one can ignore those features (I do), but finding them in existing code or having the AI coding agent use them diminishes the "easy for beginners" aspect.

Are f-strings not easy for beginners? What would you prefer instead?

Re: Python string literals are kinda funny

#14
post #11

Been using python for almost 10 years. I never use any of the funky strings. Instead of reading like 10 PEPs for f strings, I just use the + operator on strings and backslash escaping, big whoop.

Right, because x + " " + y is more clear than of simply f"{x} {y}".

Been using python for longer than 10 years and immediately started using f-strings when I could. It takes almost no time to understand the basics.

Re: Python string literals are kinda funny

#15
post #11

Been using python for almost 10 years. I never use any of the funky strings. Instead of reading like 10 PEPs for f strings, I just use the + operator on strings and backslash escaping, big whoop.

age = 32

print(f"Age: {age}")

Thus concludes the lecture on f-strings.

Re: Python string literals are kinda funny

#16
post #11

Been using python for almost 10 years. I never use any of the funky strings. Instead of reading like 10 PEPs for f strings, I just use the + operator on strings and backslash escaping, big whoop.

Instead of 10 PEPs, you could read one helpful cheatsheet: https://www.pythonmorsels.com/string-formatting/#cheat-sheet....
Post reply on HN