To clarify how Python handles two equal objects

Roel Schroeven roel at roelschroeven.net
Tue Jan 10 16:07:08 EST 2023


Jen Kris via Python-list schreef op 10/01/2023 om 21:41:
> But where they have been set to the same object, an operation on one will affect the other as long as they are equal (in Python).
As long as they are *identical*, not equal. Identical as in having the 
same identity as Python defines it.
I advise you to read Ned Batchelder's explanation about names and values 
in Python, or watch his presentation, to get a good understanding. See 
https://nedbatchelder.com/text/names1.html

-- 
"Don't Panic."
         -- Douglas Adams, The Hitchhiker's Guide to the Galaxy



More information about the Python-list mailing list