xcsp3team / pycsp3

A Python Library for modeling combinatorial constrained problems
https://www.pycsp.org
MIT License
61 stars 9 forks source link

Syntax warning: "is" used with literal. Did you mean "==" in compiler.py:271 #34

Closed wjsuijlenh closed 1 year ago

wjsuijlenh commented 1 year ago

Python 3.10.6 (default on Ubuntu 22.04) gives a syntax warning about the suspicious use of "is" instead of "==" in the condition on line 271 of compiler.py:

 if Compilation.filename is "" and options.output is not None:

When I read the line, I also assume Compilation.filname == "" is meant instead.

 if Compilation.filename == "" and options.output is not None:
xcsp3team commented 1 year ago

Thanks for the issue. The modification has been performed and pushed