m4ll0k / BBTz

BBT - Bug Bounty Tools (examples💡)
1.72k stars 471 forks source link

Use ==/!= to compare constant literals (str, bytes, int, float, tuple) #16

Closed cclauss closed 2 years ago

cclauss commented 3 years ago

$ flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics

./BBTz/whoxy.py:15:4: F632 use ==/!= to compare constant literals (str, bytes, int, float, tuple)
if API_KEY is "":
   ^
./BBTz/gctexposer.py:62:9: F821 undefined name 'sys'
        sys.exit(parser.print_help())
        ^
1     F632 use ==/!= to compare constant literals (str, bytes, int, float, tuple)
1     F821 undefined name 'sys'
2

$ python3

>>> "" == ""
True
>>> "" is ""
<stdin>:1: SyntaxWarning: "is" with a literal. Did you mean "=="?
True
>>> API_KEY = "API_"
>>> API_KEY += "KEY"
>>> API_KEY == "API_KEY"
True
>>> API_KEY is "API_KEY"
<stdin>:1: SyntaxWarning: "is" with a literal. Did you mean "=="?
False