Why does Python say two identical-looking lists are not the same object?
TechnologyI'm making a small practice organiser for storage boxes. Two separately created Python lists both contain the single string “spare cables”. Comparing them with is gives False, so I thought one list might contain an invisible difference.
Python's built-in-types reference distinguishes equality, tested with ==, from object identity, tested with is. Python's comparison reference
I'm trying to compare the listed contents, not decide whether two physical boxes are the same box. How should I choose the comparison and check my understanding before I build more rules around this result?