Explaining names vs variables in Python

Salvatore DI DIO salvatore.didio at gmail.com
Wed Mar 2 03:32:13 EST 2016


Hello,

I know Python does not have variables, but names.
Multiple names cant then be bound to the same objects.

So this behavior 

>>> b = 234
>>> v = 234
>>> b is v
True

according to the above that is ok



But where is the consistency ? if I try :

>>> v = 890
>>> w = 890
>>> v is w
False

It is a little difficult to explain this behavior to a newcommer in Python

Can someone give me the right argument to expose ?

Regards




More information about the Python-list mailing list