4 ms·
I agree about the noise, but, it's much easier to work with. raise FooException("Can't load bar") works, as does f"The flange is elevated by {flange['spronge']}
by ben509 8y ago
I agree about the noise, but, it's much easier to work with. raise FooException("Can't load bar") works, as does f"The flange is elevated by {flange['spronge']} degrees of spronge."
- mixmastamyk 8y agoGoes both ways, sometimes there's text to quote: raise KeyError('"%s" not found.' % name) f'The flange is elevated by {flange["spronge"]} degrees of spronge.' I don't normally use many contractions or possessives in my code, but am willing to admit it happens occasionally.
- zestyping 8y agoYep, that's why I like how repr() does it. Guido solved this nicely a long time ago :)