Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It's also for logging:

    log.debug(f"The value of counter was {counter}, the nonce was {nonce}")
builds a new string every time the interpreter hits this line. Whereas

    log.debug(t"The value of counter was {counter}, the nonce was {nonce}")
passes a Template to the debug() function that bails out if debug mode is not on and doesn't build a string.


Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: