3 ms·
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 c
by smohare 2mo ago
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.
- layer8 2mo agoPersonally I do find the first version clearer, because it is based on general language rules.
- TZubiri 2mo agoEspecially if you come from other languages. a + " " + b will be clearer to devs that aren't senior python developers. the f string thing is just a marginal improvement at the cost of alienating other devs. But it's great for gatekeeping and job security.
- shooly 2mo ago> come from other languages According to Wikipedia[1] the history of string formatting goes back to 1950s. Also, basically every major programming language these days implements it in some form. [1] https://en.wikipedia.org/wiki/Printf https://en.wikipedia.org/wiki/Printf > senior python developers > great for gatekeeping and job security Ah, okay, it's just a troll.
- TZubiri 2mo agoBut the link you shared describes a syntax that is very different. "%T", T t not "{ (expr).__str__()} " > Ah, okay, it's just a troll. If that helps you sleep at night