I was called out for using old school % formatting instead of f strings today. I was using them because I remember reading somewhere that they were more performant in some situations. I looked it up, and it turns out it wasn't my use case. But good to know:

If you call logger.debug("this is %s to format", expensive()), the string won't be formatted unless the logger is going to emit a debug message.

Note that expensive() is an argument, not after a % sign.

0

If you have a fediverse account, you can quote this note from your own instance. Search https://recurse.social/users/blair/statuses/115149237779139278 on your instance and quote it. (Note that quoting is not supported in Mastodon.)