JulianEberius / SublimePythonIDE

ST3 only: A rewrite of SublimeRope for ST3, uses the Rope library to add python completions and refactoring to ST3
GNU General Public License v2.0
267 stars 38 forks source link

getting invalid pep8 e712 warning #92

Open tjvoll opened 6 years ago

tjvoll commented 6 years ago

I'm getting a warning that the following should be using is instead of ==.

rows = data.query(schema.Publish).filter(condish == False)

As far as I understand, pep8 specifies that for if statements only.

autumnjolitz commented 6 years ago

Your understanding is in error. No worries, it happens to anyone.

PEP8 section:

- Don't compare boolean values to True or False using ==.

Yes:   if greeting:
No:    if greeting == True:
Worse: if greeting is True:

The key part is "Don't compare boolean values to True or False using ==". That applies to all cases, including the one you have questioned. The relation of if to it only applies as an example.