flake8-string-format icon indicating copy to clipboard operation
flake8-string-format copied to clipboard

string used with comparisons such as == and in

Open jayvdb opened this issue 10 years ago • 1 comments

Two cases in TACTIC

src/tactic/ui/panel/custom_layout_wdg.py:611:36: P103 other string does contain unindexed parameters
        if not plugin or plugin == '{}':
...
src/pyasm/common/common.py:732:26: P103 other string does contain unindexed parameters
            elif char in '''!@$%^&*()={}[]:"|;'\\<>?''':

If a whitelist is added, many string methods such as str.strip are known to be safe.

jayvdb avatar Oct 20 '15 08:10 jayvdb

The only failure in vcrpy is https://github.com/kevin1024/vcrpy/blob/master/tests/unit/test_filters.py#L202

assert request.body == b'{}'

I believe unassigned strings (except docstrings of course) not used in .format calls can be skipped safely as they will not end up in a .format call.

jayvdb avatar Dec 08 '15 00:12 jayvdb