Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed2.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.031 X-Spam-Evidence: '*H*': 0.95; '*S*': 0.02; 'mrab': 0.05; 'attribute': 0.07; 'string': 0.09; 'cc:addr:python-list': 0.11; '"%s"': 0.16; 'key)': 0.16; 'need:': 0.16; 'subject:object': 0.16; 'wrote:': 0.18; 'thu,': 0.19; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; 'am,': 0.29; "i'm": 0.30; "skip:' 10": 0.31; 'subject:from': 0.34; 'but': 0.35; 'different': 0.65; 'to:addr:gmail.com': 0.65; "how's": 0.74; 'object:': 0.84; 'subject:add': 0.91; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=pahlevanzadeh.org; s=default; h=Content-Transfer-Encoding:Mime-Version:Content-Type:References:In-Reply-To:Date:Cc:To:From:Subject:Message-ID; bh=IbAzI58zcelveOUOnShitlt9djgZJd5P+aZpnnPugjY=; b=Uj5xKZQwctkdcj8W6Nil1ZB8THL4DloaLAG/XXTeps5KCbHX4FMBbd/qchYFL23ugZYHzFp199V3miybP/N9vtlQVzTE/FyIkXHBLU4yBAXD+umoyosOkYv6pJQdeqk0/ajhOzhSqX12jH5wIae/A6+dJi8BXyGkIUCX5WuU2BI=; Subject: Re: how to add object from dict From: Mohsen Pahlevanzadeh To: Chris Angelico Date: Thu, 17 Oct 2013 04:45:44 +0330 In-Reply-To: References: <1381961694.21908.13.camel@debian> <525F3297.2040406@mrabarnett.plus.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.8.5-2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - part7.royal-servers.com X-AntiAbuse: Original Domain - python.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - pahlevanzadeh.org X-Get-Message-Sender-Via: part7.royal-servers.com: authenticated_id: mohsen@pahlevanzadeh.org 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: 12 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1381972564 news.xs4all.nl 15872 [2001:888:2000:d::a6]:40315 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:56924 On Thu, 2013-10-17 at 11:46 +1100, Chris Angelico wrote: > On Thu, Oct 17, 2013 at 11:43 AM, MRAB wrote: > > I'm guessing, but perhaps you need: > > > > instance = getattr(self, "%s" % key) > > How's that different from getattr(self,str(key))? > > ChrisA I get the string of CheckBox instead of its Object: AttributeError: 'Ui_ProjectsFind' object has no attribute 'ssss'