Alex Martelli wrote:
> Ben Wilson <[EMAIL PROTECTED]> wrote:
>
>> Perhaps:
>>
>> def dictionary_make_attributes(self, settings):
>> for k,v in settings:
>> setattr(self, k, v)
for k,v in settings.items()
> This is a very general solution and will work for all kinds of objects
> wit
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
Ben Wilson <[EMAIL PROTECTED]> wrote:
> Perhaps:
>
> def dictionary_make_attributes(self, settings):
> for k,v in settings:
> setattr(self, k, v)
This is a very general solution and will work for all kinds of objects
with settable attributes, even if some of the attributes are prop
Perhaps:
def dictionary_make_attributes(self, settings):
for k,v in settings:
setattr(self, k, v)
http://ftp.python.org/doc/lib/built-in-funcs.html#l2h-64
--
http://mail.python.org/mailman/listinfo/python-list