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
Diez B. Roggisch wrote:
> Ilias Lazaridis schrieb:
>> remark: not sure if the term "dictionary" is correct here.
>>
>> I have the following situation:
>>
>> within a setup.cfg, settings are passed this way:
>>
>> settings=project_page=theProjectPage.com
>> myVar=myValue
>>
>> those are acce
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
Ilias Lazaridis schrieb:
> remark: not sure if the term "dictionary" is correct here.
>
> I have the following situation:
>
> within a setup.cfg, settings are passed this way:
>
> settings=project_page=theProjectPage.com
> myVar=myValue
>
> those are accessible later like this:
>
> set
remark: not sure if the term "dictionary" is correct here.
I have the following situation:
within a setup.cfg, settings are passed this way:
settings=project_page=theProjectPage.com
myVar=myValue
those are accessible later like this:
settings['project_page'] / settings['myValue']
-