Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!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.007 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'attribute': 0.07; 'python': 0.08; 'to:name:python list': 0.09; 'thanks!': 0.14; "'int'": 0.16; 'error).': 0.16; 'from:addr:lanyjie': 0.16; 'from:name:yingjie lan': 0.16; 'received:124.205': 0.16; 'received:98.139.52.189': 0.16; 'reply-to:addr:lanyjie': 0.16; 'reply-to:name:yingjie lan': 0.16; 'yingjie': 0.16; '>>>': 0.18; '(which': 0.19; 'seems': 0.20; '(most': 0.21; 'traceback': 0.24; 'skip:= 10': 0.28; 'pass': 0.29; 'class': 0.29; 'hi,': 0.32; 'assigned': 0.32; 'object': 0.33; 'to:addr:python-list': 0.34; 'last):': 0.34; 'file': 0.36; 'but': 0.37; 'why': 0.39; 'to:addr:python.org': 0.40; 'further': 0.64; 'here': 0.65; 'received:98.139.52': 0.67; 'header:Reply-To:1': 0.71; 'deviate': 0.84 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 737380.50639.bm@omp1027.mail.ac4.yahoo.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1323169564; bh=qnYUkKTiyQ2lCprr3EpDwR1iCiQnAtppO5TKOuwB/8I=; h=X-YMail-OSG:Received:X-Mailer:Message-ID:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=2uCRy1bIc+Urt5VZtfkwb2fkqhiq56vPlgIgxq6bhG1jek1DNOuBalxslAnO6Vru6ZcHMiF2mh3x44d258+5/7wSYc+M+rlcrKoM9i6GhRsDukyxMWxtVq4g1gouC5BRWpbk2XUGv22gamBrWeIkmPqb0TAcE7AWDBmEWmx7URI= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:Message-ID:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=A5Ecdua4Y8yA3Oz3C0XGHqphZx3iATT537qERR7PWyyDZSwJcFZT78QmWmoixtSk7LvPgAivKk3vBxHAvURco0YWdjrhe0tLaDbc7BVJwhBEUOXmDZjZ/DUj2Mq20+f1GCXH2EYEejXBJ8zUZZGvDwkTA4lggcUGW4L4ErhIScI=; X-YMail-OSG: x221QW0VM1lc4BojdhBNcUrynDS23No_U9mDf2wA5aqTjl9 t8ueM.CTudgM6CO2O6JrcZqIi66LeudR6vNciqKWwpIrKSdQa81TTU_jWqkf BAtOPCq3xQWSK19x8A2pU2BLAO1NwDLjUHei3HQQJwsihUGFhcMcpEW.3mjk XPI4lBJoEk7jH0gVhM_dCx2hTtJJxR99kDAqjJ2imoSJ2mJX5b7BTz76wuAm sbKhxzOpiiJKLr81zvbeWnrODr9miUt_a.W4K2kR6fXsVF0XrTDGTW3WHG88 wQ0V0GAyq6PF0rIR9KfVGlfAN.3EDNKFrijHGmLS5DMXAM8bClNSuYFoRq5H vp9FL5DlFQWDs7NSWPy5BwOgoL7GvSLPqEB6BAGWKcgapZPqJYRORJZPFrT2 Txog6vUSz68LvHxvZwBcUTRAORbRNMLufpP.FRX3y X-Mailer: YahooMailWebService/0.8.115.331698 Date: Tue, 6 Dec 2011 03:06:04 -0800 (PST) From: Yingjie Lan Subject: the deceptive continuous assignments To: python list MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: Yingjie Lan 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: 10 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1323169726 news.xs4all.nl 6967 [2001:888:2000:d::a6]:45884 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:16717 Hi, I just figured out this with Python3.2 IDLE:=0A=0A>>> class k: pass=0A>= >> x=3Dk()=0A>>> x.thing =3D 1=0A>>> x.thing=0A1=0A>>> x =3D x.thing =3D 1= =0ATraceback (most recent call last):=0A=A0 File "", line 1, in = =0A=A0 =A0 x =3D x.thing =3D 1=0AAttributeError: 'int' object has n= o attribute 'thing'=0A>>> x=0A1=0A>>>=0A=0A=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=0Awhen I do x=3Dx.thing=3D1, I thought it would=0Abe lik= e in C, 1 is first assigned to x.thing,=0Athen it is further assigned to x.= =0A=0ABut what seems to be going on here is=0Athat 1 is first assigned to x= , then=0Ato x.thing (which causes an error).=0A=0AAny reason why would Pyth= on deviate=0Afrom C in this regard?=0A=0AThanks!=0A=0AYingjie