To clarify how Python handles two equal objects
Frank Millman
frank at chagford.com
Sun Jan 15 00:46:44 EST 2023
On 2023-01-15 4:36 AM, Roel Schroeven wrote:
>
>
> Chris Angelico schreef op 15/01/2023 om 1:41:
>> On Sun, 15 Jan 2023 at 11:38, Jen Kris <jenkris at tutanota.com> wrote:
>> >
>> > 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.
>> >
>>
>> Yep. This is not specific to arrays; it is true of all Python objects.
>> Also, I suspect you're still thinking about things backwards, and am
>> trying to lead you to a completely different way of thinking that
>> actually does align with Python's object model.
> Indeen, I also still have the impression that Jen is thinking in terms
> of variables that are possible aliased such as you can have in a
> language like C, instead of objects with one or more names like we have
> in Python. Jens, in the Python model you really have to think of the
> objects largely independently of the names that are or are not
> referencing the objects.
>
My 'aha' moment came when I understood that a python object has only
three properties - a type, an id, and a value. It does *not* have a name.
Frank Millman
More information about the Python-list
mailing list