- Copy dictionary entries to attributes

Ilias Lazaridis ilias at lazaridis.com
Tue Feb 21 06:14:53 EST 2006


Ben Wilson wrote:
> Perhaps:
> 
> def dictionary_make_attributes(self, settings):
>      for k,v in settings:
>          setattr(self, k, v)

this one resulted in an error:

"ValueError: too many values to unpack"

it works with this correction:

for k,v in settings.items()

> http://ftp.python.org/doc/lib/built-in-funcs.html#l2h-64



-- 
http://lazaridis.com



More information about the Python-list mailing list