2 ms·
>Debug support for f-strings. F strings are pretty awesome. I’m coming from JavaScript and partially java background. JavaScript’s string concatenation can bec
by wil421 7y ago
>Debug support for f-strings.
F strings are pretty awesome. I’m coming from JavaScript and partially java background. JavaScript’s string concatenation can become too complex and I have difficulty with large strings.
>Python 3.8 programmers will be able to do:
print(f'{foo=} {bar=}')
Pretty cool way to help with debugging. There are so many times, including today, I need to print or log some debug string.
“Debug var1 ” + var1 + “ debug var2” + var2...and so on. Forgot a space again.
- joaolvcm 7y agoBy the way, this has nothing do with f strings but for debugging JavaScript you can do something like console.log({var1,var2,var3}); And the logged object will get created with the variables content and the variable nem as key, so it will get logged neatly like {var1: "this is var1", var2: 2, var3: "3"}