scikit-hep/awkward-0.x

Syntax warning due to comparison of literals using is in Python 3.8

tirkarthi opened this issue · 1 comments

find . -iname '*.py' | grep -Ev 'test.py' | xargs -P4 -I{} python3.8 -Wall -m py_compile {}
./awkward/array/chunked.py:217: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if tpe is not None and tpe is not ():
./awkward/array/chunked.py:222: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if tpe is not None and tpe is not ():
./awkward/array/chunked.py:228: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if self._types[i] is None or self._types[i] is () or self._types[i] is tpe:

Thanks! That's a good check. Tuples being immutable, there can never be "different" empty tuples, but that doesn't mean that Python implements them as a singleton, they way it does None. That was a potentially bad assumption.