[Python-Dev] Subtle difference between f-strings and str.format() (original) (raw)
Tim Peters tim.peters at gmail.com
Wed Mar 28 14:30:04 EDT 2018
- Previous message (by thread): [Python-Dev] Subtle difference between f-strings and str.format()
- Next message (by thread): [Python-Dev] Subtle difference between f-strings and str.format()
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
[Tim]
I have a hard time imaging how that could have come to be, but if it's true I'd say the unoptimized code was plain wrong. The dumbest possible way to implement
f() and g()
is also the correct ;-) way:result = f() if not bool(result): result = g()
Heh - that's entirely wrong, isn't it? That's how or
is implemented ;-)
Same top-level point, though:
result = f() if bool(result): result = g()
- Previous message (by thread): [Python-Dev] Subtle difference between f-strings and str.format()
- Next message (by thread): [Python-Dev] Subtle difference between f-strings and str.format()
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]