flake8 complains on boolean comparison “==” in filter clause

That’s because SQLAlchemy filters are one of the few places where == False actually makes sense. Everywhere else you should not use it. Add a # noqa comment to the line and be done with it. Or you can use sqlalchemy.sql.expression.false: from sqlalchemy.sql.expression import false TestCase.obsoleted == false() where false() returns the right value for … Read more

Unintentional trailing comma that creates a tuple

pylintalready detects this as a problem (as of version 1.7). For example, here’s my tuple.py: “””Module docstring to satisfy pylint””” def main(): “””The main function””” thing = 1, print(type(thing)) if __name__ == “__main__”: main() $ pylint tuple.py No config file found, using default configuration ************* Module tuple R: 5, 0: Disallow trailing comma tuple (trailing-comma-tuple) … Read more