Evaluation of variable as f-string
Johannes Bauer
dfnsonfsduifb at gmx.de
Sun Jan 29 04:05:31 EST 2023
Am 29.01.23 um 02:09 schrieb Chris Angelico:
>>> The exact same points have already been made, but not listened to.
>>> Sometimes, forceful language is required in order to get people to
>>> listen.
>>
>> An arrogant bully's rationale. Personally, I'm fine with it. I've been
>> to Usenet for a long time, in which this way of "educating" people was
>> considered normal. But I do think it creates a deterring, toxic
>> environment and reflects back to you as a person negatively.
>
> Arrogant bully? Or someone who has tried *multiple times* to explain
> to you that what you're asking for is IMPOSSIBLE, and you need to ask
> a better question if you want a better answer?
In literally your first answer you resorted to aggressive language and
implied that what I asked wasn't what I actually wanted. It was.
Also note that in your first answer you did not answer "sorry, this is
not possible", which would have been completely sufficient as an answer.
Instead you tried your best at guesswork, implying I didn't know what I
was doing.
So, yes, absolutely toxic behavior. I fully stand by that judgement of mine.
I'll go a step further and again repeat that THIS sort of behavior is
what gives open source forums a bad rep. There's always a Lennart
Poettering, an Ulrich Drepper or maybe a Chris Angelico around who may
have great technical skill but think they can treat people like shit.
> If that's "bullying", then fine, ban me for bullying, and go find
> somewhere else where you'll be coddled and told that your question is
> fine, it's awesome, and yes, wouldn't it be nice if magic were a
> thing.
LOL, "ban you"? What the heck are you talking about, my friend?
I don't need to be coddled by you. I'm trying to give you the favor of
honest feedback, which is that you sound like an utter bully. If you
don't care, that is totally fine by me.
> They're not different things, because what you asked for is NOT
> POSSIBLE without the caveats that I gave. It is *fundamentally not
> possible* to "evaluate a string as if it were an f-string", other than
> by wrapping it in an f-string and evaluating it - with the
> consequences of that.
Yeah that sucks, unfortunately. But I'll live.
>> In other words, if there were a magic function:
>>
>> evalfstring(s, x = x)
>>
>> That would have been the ideal answer. There does not seem to be one,
>> however. So I'm back to silly workarounds.
>
> Right. Exactly. Now if you'd asked for what you REALLY need, maybe
> there'd be a solution involving format_map, but no, you're so utterly
> intransigent that you cannot adjust your question to fit reality.
Does format_map do exactly what f-strings can do? Can I pass arbitrary
functions and Python expressions insode a format_map? No? Of course not.
Then it does not answer the question.
> If that makes me a bad guy, then fine. I'll be the bad guy.
Awww, it's adorable how you're trying to frame yourself as the victim.
I'll be here if you need a hug, buddy.
> But you're not going to change the laws of physics.
Yeah we'll have to disagree about the fact that it's the "laws of
physics" preventing a specific implementation of a Python function.
Cheers,
Johannes
More information about the Python-list
mailing list