Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.szaf.org!feedme.news.telefonica.de!telefonica.de!diesel.cu.mi.it!.POSTED!not-for-mail From: pecore@pascolo.net Newsgroups: comp.lang.python Subject: Re: Explanation of list reference Date: Fri, 14 Feb 2014 23:34:04 +0100 Organization: The Sun and the Rain. Lines: 27 Message-ID: <87iosh9vdv.fsf@pascolo.net> References: <13208de8-0f85-4e60-b059-dc087c8fda41@googlegroups.com> NNTP-Posting-Host: ppp-211-23.21-151.libero.it Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: virtdiesel.mng.cu.mi.it 1392417245 30258 151.21.23.211 (14 Feb 2014 22:34:05 GMT) X-Complaints-To: abuse@diesel.cu.mi.it NNTP-Posting-Date: Fri, 14 Feb 2014 22:34:05 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) XEmacs/21.5-b34 (linux) Cancel-Lock: sha1:fMqZ/gdN6yMkQxSxiuArlxxH6Rg= Xref: csiph.com comp.lang.python:66336 dave em writes: > He is asking a question I am having trouble answering which is how a > variable containing a value differs from a variable containing a > list or more specifically a list reference. s/list/mutable object/ # Mr Bond and Mr Tont are two different ob^H^H persons james_bond = SecretAgent() james_tont = SecretAgent() # in some circles, Mr Bond is know as agent 007 agent_007 = james_bond # Mr Bond, aka 007, is sent to the Caribbeans to crush Spectre agent_007.move_to('Barbados') print agent_007.location print james_bond.location # Mr Bond, alas, retires and his place in the Mi5 is taken, alas, by Mr Tont agent_007 = james_tont # Mr Tont, aka 007, is sent to Hong Kong to, to, whatever... agent_007.move_to('Hong Kong') print agent_007.location print james_bond.location