how to add object from dict

Chris Angelico rosuav at gmail.com
Wed Oct 16 20:46:52 EDT 2013


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))?

ChrisA



More information about the Python-list mailing list