jifunks / botany

command line virtual plant buddy
ISC License
438 stars 32 forks source link

don't use "is" to compare string literals #36

Closed cosarara closed 3 years ago

cosarara commented 3 years ago

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.