Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!feeds.phibee-telecom.net!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.016 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'attributes': 0.05; "subject:' ": 0.15; 'cc:addr:python-list': 0.15; 'subject:named': 0.16; 'thing?': 0.16; 'wrote:': 0.16; 'jan': 0.19; 'cheers,': 0.20; 'trying': 0.20; 'cc:no real name:2**0': 0.21; "doesn't": 0.22; 'header:In-Reply-To:1': 0.22; 'assigning': 0.23; 'index': 0.24; 'cc:2**0': 0.25; 'pm,': 0.26; 'message-id:@mail.gmail.com': 0.28; 'cc:addr:python.org': 0.29; 'tue,': 0.32; 'object': 0.33; 'there': 0.33; 'received:209.85.212': 0.34; 'but': 0.37; 'received:google.com': 0.37; 'using': 0.37; 'received:209.85': 0.38; 'received:209': 0.39; '31,': 0.64; 'emmanuel': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=bOyRZmLc/FksIbTqdvAopsSezfNOzFGDat3RXCtLvDg=; b=dxAaLjdeV3wFWWnt/r8kMjc4zn9k5JYnO4b68f8SwqMqpIBNbArNnl06R0qn5lSTUz tjb2AUvSPNEpLQzkFhVI5g0kl9DfjkZTGskUJV08DpiGMFkRUn3Yr7oDqUp3l8br6jSP VFsEJi29Nfampi7uqPWWwCmLGpsfCM6jK2aIA= MIME-Version: 1.0 In-Reply-To: References: From: Ian Kelly Date: Tue, 31 Jan 2012 18:15:09 -0700 Subject: Re: 'class' named tuple To: Emmanuel Mayssat Content-Type: text/plain; charset=ISO-8859-1 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: 10 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1328058940 news.xs4all.nl 6908 [2001:888:2000:d::a6]:55932 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:19675 On Tue, Jan 31, 2012 at 5:54 PM, Emmanuel Mayssat wrote: > I have the following program. > I am trying to have index the attributes of an object using __getitem__. > Reading them this way works great, but assigning them a value doesn't > Is there a way to do such a thing? For assignment, use __setitem__. Cheers, Ian