PyUtilib / pyutilib

A collection of general Python utilities, including logging and file IO, subprocess management, plugin systems, and workflow management.
BSD 3-Clause "New" or "Revised" License
34 stars 21 forks source link

use format function #36

Closed nerdoc closed 4 years ago

codecov-io commented 6 years ago

Codecov Report

Merging #36 into master will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #36   +/-   ##
=======================================
  Coverage   65.18%   65.18%           
=======================================
  Files          85       85           
  Lines        8611     8611           
=======================================
  Hits         5613     5613           
  Misses       2998     2998

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update b82c780...1267d3f. Read the comment docs.

coveralls commented 6 years ago

Coverage Status

Coverage increased (+1.4%) to 65.664% when pulling 1267d3f2b41e05dcae8904903bba4c31cf5f17fa on nerdoc:patch-2 into b82c780e85fa5de9d356d4700468f4aaf5c78780 on PyUtilib:master.

coveralls commented 6 years ago

Coverage Status

Coverage increased (+1.4%) to 65.664% when pulling 1267d3f2b41e05dcae8904903bba4c31cf5f17fa on nerdoc:patch-2 into b82c780e85fa5de9d356d4700468f4aaf5c78780 on PyUtilib:master.

coveralls commented 6 years ago

Coverage Status

Coverage increased (+1.4%) to 65.664% when pulling 1267d3f2b41e05dcae8904903bba4c31cf5f17fa on nerdoc:patch-2 into b82c780e85fa5de9d356d4700468f4aaf5c78780 on PyUtilib:master.

coveralls commented 6 years ago

Coverage Status

Coverage increased (+1.4%) to 65.664% when pulling 1267d3f2b41e05dcae8904903bba4c31cf5f17fa on nerdoc:patch-2 into b82c780e85fa5de9d356d4700468f4aaf5c78780 on PyUtilib:master.

coveralls commented 6 years ago

Coverage Status

Coverage increased (+1.4%) to 65.664% when pulling 1267d3f2b41e05dcae8904903bba4c31cf5f17fa on nerdoc:patch-2 into b82c780e85fa5de9d356d4700468f4aaf5c78780 on PyUtilib:master.

coveralls commented 6 years ago

Coverage Status

Coverage increased (+1.4%) to 65.664% when pulling 1267d3f2b41e05dcae8904903bba4c31cf5f17fa on nerdoc:patch-2 into b82c780e85fa5de9d356d4700468f4aaf5c78780 on PyUtilib:master.

whart222 commented 6 years ago

I'm OK with this change, but I'd like to know what motivates it.

nerdoc commented 6 years ago

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...

jsiirola commented 6 years ago

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.

nerdoc commented 6 years ago

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...

jsiirola commented 4 years ago

(Belatedly) closing per discussion