3 ms·
My last remaining complaint with new formatting is with Pylint and logging messages. The old-style way is to write: logging.debug('some value: %d', 123) w
by kstrauser 12y ago
My last remaining complaint with new formatting is with Pylint and logging messages. The old-style way is to write:
logging.debug('some value: %d', 123)
which avoids the cost of string interpolation if that log message wasn't going to be emitted, say because the log level is higher than DEBUG. If you instead write:
logging.debug('some value: {}'.format(123))
then Pylint will complain that I "Use % formatting in logging functions but pass the % parameters as arguments (logging-format-interpolation)".
Yes, I can disable that particular warning, either by maintain a pylintrc file or adding annotations to the source code. Yes, this is a dumb complaint. But yes, it still bugs me.