python - PyCharm warning: "format doesn't require a mapping". What does it mean? -
for reason pycharm warns me line of code. i'm logging content of dictionary , gets warning: format doesn't require mapping
self._logger.info('device channels set: %s' % self._device_channels)
the code works fine , not important, i'm getting quite few of these , don't understand pycharm trying tell me.
i've googled not found helpful.
i assume pycharm warns using simple format string %s
, while providing dictionary formatting argument. when using named formats (i believe %(name)s
), dictionary argument can used fill format value of argument['name']
.
to avoid warning, try coercing argument simple string yourself, matching format in string , argument provide:
self._logger.info('device channels set: %s' % str(self._device_channels))
Comments
Post a Comment