is not is a single binary operator, and has behavior different than using is and not separated. is not evaluates to False if the variables on either side of the operator point to the same object and True otherwise.▶ The surprising comma...
Such behavior is due to CPython optimization (called string interning) that tries to use existing immutable objects in some cases rather than creating a new object every time. After being interned, many variables may point to the same string object in memory (thereby saving memory). In the ...