Newbie question. Are those different objects ?

random832 at fastmail.us random832 at fastmail.us
Fri Dec 20 10:24:35 EST 2013


On Fri, Dec 20, 2013, at 10:16, dec135 at msn.com wrote:
> The second time we type print type y, how does the program knows which
> one of the y's it refers to ?  Is the first y object deleted ?

y does not refer to the first object anymore after you've assigned the
second object to it. In CPython, if there are no other references to the
string object, yes it is deleted - other implementations may defer
deletion to a later time.



More information about the Python-list mailing list