A certainl part of an if() structure never gets executed.
Ferrous Cranus
support at superhost.gr
Sun Jun 16 09:47:46 EDT 2013
On 16/6/2013 2:13 μμ, Jussi Piitulainen wrote:
> If, instead of the above, you have
>
> a = 6
> b = a
> b = 5
>
> you will find that b == 5 and a == 6. So b is not the same as a. Else
> one would have changed when the other changed. I would say that a and
> b are different variables. They had the same value, briefly.
If they were different variables then they would have different memory
addresses and they would act like two different objects.
But... both a and b are for a fact mappings for the same memory address
as seen form the following command.
>>> id(a) == id(b)
True
They are like the same object with 2 different names.
Like i'am a human being and me Greek friends call me "Νίκος" while you
guys call me "Nick".
That the way i understand it so far.
--
What is now proved was at first only imagined!
More information about the Python-list
mailing list