You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After a quick search in the code using the next flake8 command: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics I didn't follow any python3 issue. So, in my opinion openlex might be compatible with py3.
BTW I follow the next issues:
➜ OpenLex git:(master) flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | grep F632
./modules/html2text.py:181:12: F632 use ==/!= to compare constant literals (str, bytes, int, float, tuple)
./modules/html2text.py:181:29: F632 use ==/!= to compare constant literals (str, bytes, int, float, tuple)
./modules/html2text.py:182:20: F632 use ==/!= to compare constant literals (str, bytes, int, float, tuple)
3 F632 use ==/!= to compare constant literals (str, bytes, int, float, tuple)
In the case of the Aaron Swartz's program html2text.py, the issue that your command is pointing to, has the following lines:
def onlywhite(line):
"""Return true if the line does only consist of whitespace characters."""
for c in line:
if c is not ' ' and c is not ' ':
return c is ' '
return line
My question is: "is not" and "is", are the same thing that == and != in Python 3? In that case, I wouldn't need to change it.
Activity
matiasdemarchi commentedon Jun 27, 2021
Yes, I think i can fix it. Thanks for the suggestion!
matiasdemarchi commentedon Jul 2, 2021
In the case of the Aaron Swartz's program html2text.py, the issue that your command is pointing to, has the following lines:
def onlywhite(line):
"""Return true if the line does only consist of whitespace characters."""
for c in line:
if c is not ' ' and c is not ' ':
return c is ' '
return line
My question is: "is not" and "is", are the same thing that == and != in Python 3? In that case, I wouldn't need to change it.
eamanu commentedon Jul 3, 2021
They aren't the same.
The
isoperator will returnTrueif the variable is pointing to the same objectAnd
==will compare the value itself.for instance (I'm on py3.9), using is:
But if we compare the value equality,
Looking on upstream [0], that lines was not changed, so, I would like to hear the opinion of
@marian-vignau about what to do with this SyntaxWarning.
BTW: seems that exist a newer fork of html2text https://github.com/Alir3z4/html2text/
[0] https://github.com/aaronsw/html2text/blob/master/html2text.py#L92