Good question. Personally I hate this warning, I like new-style formatting
far more than "%"-style formatting (and in fact, what pylint wants is
neither -- it prefers something like `'my msg is %',
my_msg)`). The stated reason (
is that this defers the string interpolation until it is actually required
(if/when the logger is called) and therefore provides a performance
enhancement -- I find it incredibly hard to believe that this yields any
measurable improvement. In addition, I haven't found any PEP or other
official documentation that says this behavior is preferred (as opposed to
merely possible). I would support disabling the warning entirely.


On Mon, Oct 17, 2016 at 10:04 AM Maycock, Luke <> wrote:

> Hi Dev List,
> We're currently working on removing all of the new warnings
> from some of our code and we're noticing the following quite a lot:
> "Use % formatting in logging functions and pass the % parameters as
> arguments"
> This is being flagged up on lines such as:
> ""Running command:\n {}".format(hql))"
> We're just wondering whether it is indeed preferred to use the %
> parameters as suggested or whether this is an issue with the
> setup.
> Can anybody give a judgement on this? If the .format is preferred, then
> we'll look into changing the settings.
> Thanks,
> Luke Maycock
> ________________________________
> This e-mail and any attachments may be confidential or legally privileged.
> If you received this message in error or are not the intended recipient,
> you should destroy the e-mail message and any attachments or copies, and
> you are prohibited from retaining, distributing, disclosing or using any
> information contained herein. Please inform us of the erroneous delivery by
> return e-mail. Thank you for your cooperation.

Reply via email to