To clarify how Python handles two equal objects

Jen Kris jenkris at tutanota.com
Sat Jan 14 19:38:20 EST 2023


Yes, in fact I asked my original question – "I discovered something about Python array handling that I would like to clarify" -- because I saw that Python did it that way.  



Jan 14, 2023, 15:51 by rosuav at gmail.com:

> On Sun, 15 Jan 2023 at 10:32, Jen Kris via Python-list
> <python-list at python.org> wrote:
>
>> The situation I described in my original post is limited to a case such as x = y ... the assignment can be done simply by "x" taking the pointer to "y" rather than moving all the data from "y" into the memory buffer for "x"
>>
>
> It's not simply whether it *can* be done. It, in fact, *MUST* be done
> that way. The ONLY meaning of "x = y" is that you now have a name "x"
> which refers to whatever object is currently found under the name "y".
> This is not an optimization, it is a fundamental of Python's object
> model. This is true regardless of what kind of object this is; every
> object must behave this way.
>
> ChrisA
> -- 
> https://mail.python.org/mailman/listinfo/python-list
>



More information about the Python-list mailing list