how to add object from dict

MRAB python at mrabarnett.plus.com
Thu Oct 17 04:40:17 EDT 2013


On 17/10/2013 01:46, Chris Angelico wrote:
> On Thu, Oct 17, 2013 at 11:43 AM, MRAB <python at 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.



More information about the Python-list mailing list