Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!selfless.tophat.at!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!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.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'nasty': 0.07; '>>>>': 0.09; 'integer,': 0.09; 'am,': 0.13; 'wrote:': 0.15; '[])': 0.16; 'curiosity,': 0.16; 'orientation;': 0.16; 'set;': 0.16; 'subject:behavior': 0.16; 'subject:example': 0.16; 'subject:set': 0.16; 'there...': 0.16; 'typo': 0.16; 'method.': 0.16; 'cc:addr :python-list': 0.16; 'pm,': 0.16; 'cheers,': 0.19; 'cc:2**0': 0.21; 'cc:no real name:2**0': 0.22; 'header:In-Reply-To:1': 0.22; 'received:209.85.213.46': 0.23; 'received:mail- yw0-f46.google.com': 0.23; 'sat,': 0.28; 'message- id:@mail.gmail.com': 0.28; 'object': 0.30; 'cc:addr:python.org': 0.30; 'sun,': 0.30; 'chris': 0.32; 'does': 0.32; 'calling': 0.34; 'difference': 0.34; 'integer': 0.35; 'but': 0.37; 'received:google.com': 0.38; 'received:209.85': 0.38; 'subject:: ': 0.38; 'received:209': 0.40; 'your': 0.60; 'saqib': 0.84; 'sender:addr:chris': 0.84; 'subject:class': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rebertia.com; s=google; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=P5L2vgaj1LAvnrva74UWDm8JoxvifUyTYAI86iULEjY=; b=GnSAbCjtZkHVvY95OoSaVqo9RhaPn8wMTUZ7uMILhyk3649M++Fiu8ohD1/Rt93pFT VBO9J0Afc9wiaa1QSi/JnckVO3HdS47Zp6OyD55T1WtlpDWd6F587FSoNZ377yQQSPFe KjZbB5s1PobFKsVIDII1QvZVAg4VoCNR8MtcQ= MIME-Version: 1.0 Sender: chris@rebertia.com In-Reply-To: References: <2dc52e22-5c0f-4e24-8197-df616db1a42c@u2g2000yqb.googlegroups.com> <6441039f-f226-4632-8e74-2b6415bf914e@n28g2000vbs.googlegroups.com> Date: Sat, 2 Jul 2011 18:07:49 -0700 X-Google-Sender-Auth: FoIoAve_WOmvVYjqtW5i4XBGk4Q Subject: Re: Inexplicable behavior in simple example of a set in a class From: Chris Rebert To: Chris Angelico Content-Type: text/plain; charset=UTF-8 Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 17 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1309655278 news.xs4all.nl 21861 [2001:888:2000:d::a6]:43841 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:8700 On Sat, Jul 2, 2011 at 5:46 PM, Chris Angelico wrote: > On Sun, Jul 3, 2011 at 8:23 AM, Saqib Ali wrote: >> So just out of curiosity, why does it work as I had expected when the >> member contains an integer, but not when the member contains a set? > > It's not integer vs set; it's the difference between rebinding and > calling a method. It's nothing to do with object orientation; the same > happens with ordinary variables: >>>> c=d=[] >>>> c,d > ({}, []) Nasty typo in your pseudo-interpreter-session there... Cheers, Chris