
On 24 Sep 2023, at 17:23, Chris Angelico <rosuav@gmail.com> wrote:
On Mon, 25 Sept 2023 at 00:15, Dom Grigonis <dom.grigonis@gmail.com> wrote:
I see what you mean, but this property is arguably intrinsic to what it is. And is part of f-strings vs explicit formatting property too:
variable = 1 print(f'{variable=} and b={variable}') # VS msg = 'variable={v} and b={v}' print(msg.format(v=variable))
Especially, where msg can be pre-stored and reused.
What do you mean by that? Are you suggesting that there's a massive cost in constructing a string literal and thus reusing it with .format() is more efficient than an f-string? Because that's, uhh, kinda not the point of str.format(). That was in response to it violating DRY. Just pointed out that it is intrinsic to the wider scope of how things work in different ways of formatting and for it to be completely satisfied, str.format can be used as opposed to f-strings. It was about DRY, not efficiency.
And if that isn't what you mean, what is it? Your posts are often distinctly unclear. I get the impression that you think everyone else understands your idea.
Apologies. Noted.