Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.012 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; '16,': 0.03; 'broken': 0.04; 'value,': 0.04; 'that?': 0.05; 'url:pipermail': 0.05; 'variables': 0.07; 'if,': 0.09; 'latter': 0.09; 'variables.': 0.09; 'cc:addr:python-list': 0.11; 'stored': 0.12; '"b"': 0.16; 'bind': 0.16; 'command.': 0.16; 'mapped': 0.16; 'objects.': 0.16; 're-read': 0.16; 'run:': 0.16; 'wrote:': 0.18; 'seems': 0.21; '>>>': 0.22; 'memory': 0.22; 'example': 0.22; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'header:In-Reply- To:1': 0.27; 'michael': 0.29; "i'm": 0.30; "skip:' 10": 0.31; '>>>>': 0.31; 'changed.': 0.31; 'location,': 0.31; 'names.': 0.31; 'skip:- 30': 0.32; 'url:python': 0.33; 'addresses': 0.33; 'trouble': 0.34; 'agree': 0.35; 'test': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'false': 0.36; 'url:org': 0.36; 'changing': 0.37; 'so,': 0.37; 'skip:- 20': 0.37; 'two': 0.37; 'message-id:@gmail.com': 0.38; 'mapping': 0.38; 'fact': 0.38; 'pm,': 0.38; 'address.': 0.39; 'changed': 0.39; 'url:mail': 0.40; 'skip:u 10': 0.60; 'above,': 0.60; 'course.': 0.60; 'here:': 0.62; 'address': 0.63; 'header:Message-Id:1': 0.63; 'act': 0.63; 'name': 0.63; 'different': 0.65; '15px;': 0.68; '26,': 0.68; 'address,': 0.75; 'behavior': 0.77; '128,': 0.84; 'a..': 0.84; 'subject:gets': 0.84; 'to:addr:support': 0.84; '2013,': 0.91; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:content-transfer-encoding:subject:references:from :mime-version:in-reply-to:message-id:date:cc:to:x-mailer; bh=2QEMitH12M6CH8jL2aa5aaeEWOUvjAwf2YLXP2DjHf8=; b=pB/X/WihQWcKGtePuzzSBrqlwcradQP/t4m3gEwi+9dGxMe9qGB9g5Cyy/t8XLmy0I H0Y2NWVevyKLp5cGHPKGfrNBd9VrzOvN3L3PdPby55pR4tgJ08gdbd/0XRouyv8QZ4pg tHDfCRqd/VMIktIQSuMvUVMB7Wyzbd/QPpFtG+bR9BrNLYx4TMygQRyxzZaHPmvuipfo 9Z4o1UBZwVajErlCLEhd0GCHQ2fzH87j3d/F89vsUvKqdt58G9CxcOAEK54rK6PzxKUx VTWgnqUFJoYX4Xcilh2tXODXITSg76+hbQRcVlNI9GhGHOeufpzbUumf/xtSs8H6GllS 7CNw== X-Received: by 10.194.11.72 with SMTP id o8mr7440307wjb.0.1371458377644; Mon, 17 Jun 2013 01:39:37 -0700 (PDT) Content-Type: multipart/alternative; boundary=Apple-Mail-F7CC2388-1893-4614-842B-4509E194FDD5 Content-Transfer-Encoding: 7bit Subject: Re: A certainl part of an if() structure never gets executed. References: <2bc90d3b-09c2-4315-9357-ff7f039465e0@googlegroups.com> <51ba6e92$0$29997$c3e8da3$5496439d@news.astraweb.com> <51bb454c$0$29997$c3e8da3$5496439d@news.astraweb.com> From: Michael Weylandt Mime-Version: 1.0 (1.0) In-Reply-To: Date: Mon, 17 Jun 2013 07:56:36 +0100 To: =?utf-8?B?zp3Or866zr/Pgg==?= X-Mailer: iPad Mail (10B329) Cc: "python-list@python.org" X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 158 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1371458380 news.xs4all.nl 15929 [2001:888:2000:d::a6]:43610 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:48509 --Apple-Mail-F7CC2388-1893-4614-842B-4509E194FDD5 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Jun 17, 2013, at 6:17, =CE=9D=CE=AF=CE=BA=CE=BF=CF=82 wrote: > On 16/6/2013 9:53 =CE=BC=CE=BC, R. Michael Weylandt wrote: >> On Sun, Jun 16, 2013 at 2:47 PM, Ferrous Cranus wr= ote: >>> On 16/6/2013 2:13 =CE=BC=CE=BC, Jussi Piitulainen wrote: >>>>=20 >>>> If, instead of the above, you have >>>>=20 >>>> a =3D 6 >>>> b =3D a >>>> b =3D 5 >>>>=20 >>>> you will find that b =3D=3D 5 and a =3D=3D 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. >>>=20 >>>=20 >>> If they were different variables then they would have different memory >>> addresses and they would act like two different objects. >>>=20 >>> But... both a and b are for a fact mappings for the same memory address a= s >>> seen form the following command. >>>=20 >>>>>> id(a) =3D=3D id(b) >>> True >>>=20 >>> They are like the same object with 2 different names. >>=20 >> This will depend on when the test is run: >>=20 >> a =3D 6 >> b =3D a >> a is b # True >>=20 >> b =3D 5 >> a is b # False >>=20 >> The latter is false because the binding of "b" to the int 6 was broken >> in order to bind b to the int 5. >=20 > Very surprising. > a and b was *references* to the same memory address, it was like a memory a= ddress having 2 names to be addresses as. >=20 > b =3D a name we use to address some memory location, do we agree on that? >=20 > So, b =3D 6, must have changed the stored value of its mapped memory locat= ion, but given you example it seems its changing the mapping of b to some ot= her memory address. >=20 > I don't follow its act of course. I'm having trouble understanding your grammar in the above, but please re-re= ad my note on the dual behavior of `=3D` here: http://mail.python.org/pipermail/python-list/2013-June/649990.html Michael --Apple-Mail-F7CC2388-1893-4614-842B-4509E194FDD5 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable


On Jun 17, 2013, at= 6:17, =CE=9D=CE=AF=CE=BA=CE=BF=CF=82 <support@superhost.gr> wrote:

On 16/6/2013 9:53 =CE=BC=CE=BC, R. Michael Weylandt wrote:
On Sun, Jun 16, 2013 at 2:47 PM, Fe= rrous Cranus <support@superhost.g= r> wrote:
On 16/6/2013 2:13 =CE=BC=CE=BC, Jussi Piitulainen wrot= e:

If, instead of the above, you have

a =3D 6
b =3D a
<= span>b =3D 5

you will find that b =3D= =3D 5 and a =3D=3D 6. So b is not the same as a. Else
one would have changed when the other cha= nged. 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 m= emory address as
seen form the following command.

<= blockquote type=3D"cite">id(a) =3D=3D id(b)
<= blockquote type=3D"cite">True

The= y are like the same object with 2 different names.

This will depend on when the test is run:
<= /blockquote>

a =3D 6
b =3D a
a i= s b # True
b =3D 5
a is b # False

The latter is false because the binding of "b" to the int 6 was broke= n
in order to bind b t= o the int 5.

Very surprising.<= /span>
a and b was *references* to the same memory address, it was l= ike a memory address having 2 names to be addresses as.

b =3D a name we use to address some memory location, do we agre= e on that?

So, b =3D 6, must have changed t= he stored value of its mapped memory location, but given you example it seem= s its changing the mapping of b to some other memory address.

I don't follow its act of course.

I'm having trouble understanding your grammar in t= he above, but please re-read my note on the dual behavior of `=3D` here:


Michael
= --Apple-Mail-F7CC2388-1893-4614-842B-4509E194FDD5--