Closed nerdoc closed 4 years ago
I'm OK with this change, but I'd like to know what motivates it.
I'm sorry to make so much noise for a tiny, unimportant change. My Motivation was just: I use pyutilib.component.core as separated lib in my project, and copied the init.py and core.py to mine. I changed a few things, and adapted it to Python3 - and, business as usual, backported some things to the original project ;-) I know it's not worth a fork and even these lines, but I like polishing...
My only question is what movitated the change? The current line works in all versions of Python, and the format
function is slower than %
in every version of Python.
That said, the current line should have err
in a tuple as a defensive measure (i.e. % (err,)
). As this is not a performance-critical part of code, the change is fine.
Oh yes, this may be true. This is explained fast: My lack of deep python knowledge. ;-) I just know the python recommendations, as PEP-3101 says: This PEP proposes a new system for built-in string formatting operations, intended as a replacement for the existing '%' string formatting operator. But yes, it is faster. I just tested it in a for loop. fastest: Py2 with %, slowest, Py3 with .format().
Don't hesitate to deny this patch... I've learned something again...
(Belatedly) closing per discussion
Codecov Report
Continue to review full report at Codecov.