What is the difference between is and equals in Python?
Variables, references, and memory model
Audio flashcard · 0:14Nortren·
What is the difference between is and equals in Python?
0:14
The double-equals operator compares values for equality and calls the dunder eq method. The is operator compares object identity, that is, whether two names refer to the same object in memory. Two distinct lists with the same contents are equal but not identical.
docs.python.org