Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #56946

Re: how to add object from dict

Path csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <python@mrabarnett.plus.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.048
X-Spam-Evidence '*H*': 0.92; '*S*': 0.01; 'mrab': 0.05; 'bug': 0.12; '"%s"': 0.16; 'from:addr:mrabarnett.plus.com': 0.16; 'from:addr:python': 0.16; 'from:name:mrab': 0.16; 'key)': 0.16; 'message-id:@mrabarnett.plus.com': 0.16; 'need:': 0.16; 'subject:object': 0.16; 'wrote:': 0.18; 'code.': 0.18; 'trying': 0.19; 'thu,': 0.19; 'header:User-Agent:1': 0.23; 'header:In-Reply- To:1': 0.27; 'chris': 0.29; 'am,': 0.29; "i'm": 0.30; 'subject:from': 0.34; 'but': 0.35; 'doing': 0.36; 'to:addr:python- list': 0.38; 'to:addr:python.org': 0.39; 'different': 0.65; 'header:Reply-To:1': 0.67; 'reply-to:no real name:2**0': 0.71; "how's": 0.74; 'clearer': 0.84; 'reply-to:addr:python.org': 0.84; 'subject:add': 0.91; '2013': 0.98
X-CM-Score 0.00
X-CNFS-Analysis v=2.1 cv=bKAvfpOZ c=1 sm=1 tr=0 a=0nF1XD0wxitMEM03M9B4ZQ==:117 a=0nF1XD0wxitMEM03M9B4ZQ==:17 a=0Bzu9jTXAAAA:8 a=05MOGALpfCEA:10 a=f4ofmB8XsgoA:10 a=ihvODaAuJD4A:10 a=OUOv7kDek9cA:10 a=8nJEP1OIZ-IA:10 a=EBOSESyhAAAA:8 a=8AHkEIZyAAAA:8 a=BBIqEB8VFQEA:10 a=Xu1mqtV0eAswpI7TgowA:9 a=wPNLvfGTeEIA:10 a=IsaYby2eSB0A:10 a=0tuVjd8DLWQA:10
X-AUTH mrabarnett:2500
Date Thu, 17 Oct 2013 09:40:17 +0100
From MRAB <python@mrabarnett.plus.com>
User-Agent Mozilla/5.0 (Windows NT 5.1; rv:24.0) Gecko/20100101 Thunderbird/24.0.1
MIME-Version 1.0
To python-list@python.org
Subject Re: how to add object from dict
References <1381961694.21908.13.camel@debian> <525F3297.2040406@mrabarnett.plus.com> <CAPTjJmpVP=1=ryrCW3CJdiNRH1H55+nkoqxTiBNJkTUD+raU9A@mail.gmail.com>
In-Reply-To <CAPTjJmpVP=1=ryrCW3CJdiNRH1H55+nkoqxTiBNJkTUD+raU9A@mail.gmail.com>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
Reply-To python-list@python.org
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1151.1381999217.18130.python-list@python.org> (permalink)
Lines 10
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1381999217 news.xs4all.nl 15948 [2001:888:2000:d::a6]:44020
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:56946

Show key headers only | View raw


On 17/10/2013 01:46, Chris Angelico wrote:
> On Thu, Oct 17, 2013 at 11:43 AM, MRAB <python@mrabarnett.plus.com> wrote:
>> I'm guessing, but perhaps you need:
>>
>>     instance = getattr(self, "%s" % key)
>
> How's that different from getattr(self,str(key))?
>
I'm trying to make the bug clearer for the OP by doing it the same way 
as the existing code.

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: how to add object from dict MRAB <python@mrabarnett.plus.com> - 2013-10-17 09:40 +0100

csiph-web