MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/igvny1/python_goes_brrrr/g2wckhu/?context=3
r/ProgrammerHumor • u/das_freak • Aug 26 '20
789 comments sorted by
View all comments
797
f"Python goes b{'r'*10}"
0 u/[deleted] Aug 26 '20 [deleted] 37 u/pterencephalon Aug 26 '20 I'm enjoying going through my old code and changing things to fstrings. Instead of actually fixing the real problems with the code. 13 u/jad2192 Aug 26 '20 Same, I go back through my old code and see tons of '%s %d' % (x, y) bullshit and wonder how I could have ever been such a uneducated swine. → More replies (2) 367 u/Jeb_Jenky Aug 26 '20 This made my nips so hard. 314 u/xDarkFlame25 Aug 26 '20 Ah yes fstrings, the ultimate fetish. 155 u/AinsleyBoy Aug 26 '20 I fucking love fstrings. I use them so much 42 u/Moldy_pirate Aug 26 '20 Is there ever a reason to use a “regular” string rather than an f”string? 78 u/GenericRedditor12345 Aug 26 '20 If you don’t need the functionality of an f string :p They’ve been optimized to be faster than the other formatting methods IIRC. 22 u/thirdegree Violet security clearance Aug 26 '20 Logging, there you want to do like:logging.info("value1: %s, value2: %s", 1, 2)This is because the formatting is only done if the log line will actually be emitted. It can be a significant performance boost if you have a lot of logging. 5 u/[deleted] Aug 26 '20 You can always have a lazy evaluation, using str::format, i. e. log("python goes b{0}", 'r'*10). The string would only format if it were to be used. → More replies (3) → More replies (1) → More replies (12) → More replies (4) → More replies (2) 12 u/slix_88 Aug 26 '20 Fstrings in chat bois 23 u/marmoshet Aug 26 '20 laughs in 3.6 → More replies (1) 8 u/[deleted] Aug 26 '20 Oh, fuck yeah, Fstrings. Grip it and rip it, dude! → More replies (2) → More replies (2)
0
[deleted]
37 u/pterencephalon Aug 26 '20 I'm enjoying going through my old code and changing things to fstrings. Instead of actually fixing the real problems with the code. 13 u/jad2192 Aug 26 '20 Same, I go back through my old code and see tons of '%s %d' % (x, y) bullshit and wonder how I could have ever been such a uneducated swine. → More replies (2)
37
I'm enjoying going through my old code and changing things to fstrings. Instead of actually fixing the real problems with the code.
13
Same, I go back through my old code and see tons of '%s %d' % (x, y) bullshit and wonder how I could have ever been such a uneducated swine.
→ More replies (2)
367
This made my nips so hard.
314 u/xDarkFlame25 Aug 26 '20 Ah yes fstrings, the ultimate fetish. 155 u/AinsleyBoy Aug 26 '20 I fucking love fstrings. I use them so much 42 u/Moldy_pirate Aug 26 '20 Is there ever a reason to use a “regular” string rather than an f”string? 78 u/GenericRedditor12345 Aug 26 '20 If you don’t need the functionality of an f string :p They’ve been optimized to be faster than the other formatting methods IIRC. 22 u/thirdegree Violet security clearance Aug 26 '20 Logging, there you want to do like:logging.info("value1: %s, value2: %s", 1, 2)This is because the formatting is only done if the log line will actually be emitted. It can be a significant performance boost if you have a lot of logging. 5 u/[deleted] Aug 26 '20 You can always have a lazy evaluation, using str::format, i. e. log("python goes b{0}", 'r'*10). The string would only format if it were to be used. → More replies (3) → More replies (1) → More replies (12) → More replies (4) → More replies (2)
314
Ah yes fstrings, the ultimate fetish.
155 u/AinsleyBoy Aug 26 '20 I fucking love fstrings. I use them so much 42 u/Moldy_pirate Aug 26 '20 Is there ever a reason to use a “regular” string rather than an f”string? 78 u/GenericRedditor12345 Aug 26 '20 If you don’t need the functionality of an f string :p They’ve been optimized to be faster than the other formatting methods IIRC. 22 u/thirdegree Violet security clearance Aug 26 '20 Logging, there you want to do like:logging.info("value1: %s, value2: %s", 1, 2)This is because the formatting is only done if the log line will actually be emitted. It can be a significant performance boost if you have a lot of logging. 5 u/[deleted] Aug 26 '20 You can always have a lazy evaluation, using str::format, i. e. log("python goes b{0}", 'r'*10). The string would only format if it were to be used. → More replies (3) → More replies (1) → More replies (12) → More replies (4) → More replies (2)
155
I fucking love fstrings. I use them so much
42 u/Moldy_pirate Aug 26 '20 Is there ever a reason to use a “regular” string rather than an f”string? 78 u/GenericRedditor12345 Aug 26 '20 If you don’t need the functionality of an f string :p They’ve been optimized to be faster than the other formatting methods IIRC. 22 u/thirdegree Violet security clearance Aug 26 '20 Logging, there you want to do like:logging.info("value1: %s, value2: %s", 1, 2)This is because the formatting is only done if the log line will actually be emitted. It can be a significant performance boost if you have a lot of logging. 5 u/[deleted] Aug 26 '20 You can always have a lazy evaluation, using str::format, i. e. log("python goes b{0}", 'r'*10). The string would only format if it were to be used. → More replies (3) → More replies (1) → More replies (12) → More replies (4)
42
Is there ever a reason to use a “regular” string rather than an f”string?
78 u/GenericRedditor12345 Aug 26 '20 If you don’t need the functionality of an f string :p They’ve been optimized to be faster than the other formatting methods IIRC. 22 u/thirdegree Violet security clearance Aug 26 '20 Logging, there you want to do like:logging.info("value1: %s, value2: %s", 1, 2)This is because the formatting is only done if the log line will actually be emitted. It can be a significant performance boost if you have a lot of logging. 5 u/[deleted] Aug 26 '20 You can always have a lazy evaluation, using str::format, i. e. log("python goes b{0}", 'r'*10). The string would only format if it were to be used. → More replies (3) → More replies (1) → More replies (12)
78
If you don’t need the functionality of an f string :p They’ve been optimized to be faster than the other formatting methods IIRC.
22
Logging, there you want to do like:
logging.info("value1: %s, value2: %s", 1, 2)
This is because the formatting is only done if the log line will actually be emitted. It can be a significant performance boost if you have a lot of logging.
5 u/[deleted] Aug 26 '20 You can always have a lazy evaluation, using str::format, i. e. log("python goes b{0}", 'r'*10). The string would only format if it were to be used. → More replies (3) → More replies (1)
5
You can always have a lazy evaluation, using str::format, i. e. log("python goes b{0}", 'r'*10). The string would only format if it were to be used.
str::format
log("python goes b{0}", 'r'*10)
→ More replies (3)
12
Fstrings in chat bois
23
laughs in 3.6
→ More replies (1)
8
Oh, fuck yeah, Fstrings. Grip it and rip it, dude!
797
u/geeshta Aug 26 '20
f"Python goes b{'r'*10}"