Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #81509

Re: FW: Unexpexted behaviot of python operators on list

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail
From Denis McMahon <denismfmcmahon@gmail.com>
Newsgroups comp.lang.python
Subject Re: FW: Unexpexted behaviot of python operators on list
Date Tue, 25 Nov 2014 13:07:57 +0000 (UTC)
Organization A noiseless patient Spider
Lines 28
Message-ID <m51uvc$kcs$2@dont-email.me> (permalink)
References <mailman.16274.1416907513.18130.python-list@python.org> <54746a98$0$12990$c3e8da3$5496439d@news.astraweb.com> <mailman.16277.1416918045.18130.python-list@python.org>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding 8bit
Injection-Date Tue, 25 Nov 2014 13:07:57 +0000 (UTC)
Injection-Info mx02.eternal-september.org; posting-host="66ffcfa4470a58bcddbdcd1913f98ab4"; logging-data="20892"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+w1tRbezh+I+gaulxf0D6mw1rA+jRTh3w="
User-Agent Pan/0.136 (I'm far too busy being delicious; GIT 926a150 git://git.gnome.org/pan2)
Cancel-Lock sha1:QfKwukR6W2DFA99SG0yzvqhvcBE=
Xref csiph.com comp.lang.python:81509

Show key headers only | View raw


On Tue, 25 Nov 2014 12:20:26 +0000, Mark Lawrence wrote:

> a=[1,2,3]

binds a to the list [1,2,3]

> b=a

binds b to a

> b+=[4,5]

Changes existing b, which is also a

> x=[1,2,3]

binds x to the list [1,2,3]

> y=x

binds y to x

> y=y+[4,5]

Binds y to a new list which comprises previous y plus [4,5]

-- 
Denis McMahon, denismfmcmahon@gmail.com

Back to comp.lang.python | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

FW: Unexpexted behaviot of python operators on list "PANDEY2 Archana (MORPHO)" <archana.pandey.2@morpho.com> - 2014-11-25 10:23 +0100
  Re: FW: Unexpexted behaviot of python operators on list Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-11-25 22:40 +1100
    Re: FW: Unexpexted behaviot of python operators on list Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-11-25 12:20 +0000
      Re: FW: Unexpexted behaviot of python operators on list Denis McMahon <denismfmcmahon@gmail.com> - 2014-11-25 13:07 +0000

csiph-web