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

As the sibling comment points out, it actually doesn't work that way. The first parameter is only treated as a format string _if_ there are arguments. If not, it is treated as a literal string: https://github.com/python/cpython/blob/dcea78ff53d02733ac598...


I stand corrected. Thanks.

(That's what I get for assuming consistent behavior :P)


I only found out about this quirk a few months ago immediately after I had given the same warning you had to someone else. It's extremely unintuitive.




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

Search: