0

Using pylint 2.7.1 I am having problems with the following code snippet:

   files = [
        filename
        for filename in os.listdir(str(repo_folder))
        if filename.lower().startswith("license")
        or filename.lower().startswith("copying")  # line 197
    ]

When running pylint I get the warning

code.py:197:13: W503 line break before binary operator

when I change the code to the following:

    files = [
        filename
        for filename in os.listdir(str(repo_folder))
        if filename.lower().startswith("license") or
        filename.lower().startswith("copying")
    ]

I get the warning

code.py:196:55: W504 line break after binary operator

This looks like a bug to me. I cannot possibly see a way to neither have the line-break after nor before the operator (when you have to use a line break).

Maybe this version of pylint is to be used for Quantum Computing?

Alex
  • 41,580
  • 88
  • 260
  • 469
  • 3
    W503 is wrong, disable it. Afaik both of these aren't enabled by default, because they contradict eachother. – L3viathan Mar 12 '21 at 07:32
  • Thanks - now I have to figure out why disabling this warning does not work ... B ut this is another question – Alex Mar 12 '21 at 07:41

0 Answers0