by makecheck · 8y ago · 0 comments
Generally the advice of “pick a few failure types and stick to them” is exactly right. You not only encourage error handling to take place but that code is likely to remain correct/complete over time.
Easily avoided by using the latest Python feature, added in 3.6: Formatted string literals, a.k.a. f-strings¹. Instead of using
"foo {} baz".format(bar)
you use f"foo {bar} baz"
1. https://www.python.org/dev/peps/pep-0498