The is operator checks if the objects are the same (that is, if id(x) == id(y)). While this might work for small numbers and, I guess, small strings, it could fail just as well. AFAIK, the only literals it should be used with are None, True and False.
This fixes a SyntaxWarning in Python 3.8.6 too.
The is operator checks if the objects are the same (that is, if id(x) == id(y)). While this might work for small numbers and, I guess, small strings, it could fail just as well. AFAIK, the only literals it should be used with are None, True and False. This fixes a SyntaxWarning in Python 3.8.6 too.