ValvePython / vdf

📜 Package for working with Valve's text and binary KeyValue format
https://pypi.org/project/vdf/
MIT License
165 stars 30 forks source link

tests: Avoid problematic use of "is" operator #35

Closed smcv closed 3 years ago

smcv commented 3 years ago

The "is" operator compares objects by identity, not value. It would be valid for a Python implementation to have two different int objects with value 2 (although in practice CPython doesn't).

Recent Python versions detect this with a warning:

SyntaxWarning: "is" with a literal. Did you mean "=="?