i did this because this will read colors into a nested variable<br><br>How would i make this work the way you suggest? I already have it working now :)<br><br>Not able to set to dict value with setattr, how to do this too(sorry if off subject)? <br>
<br>I can set it like this:<br><br>                    for i in self.opt['properties'].keys():<br>                        self.opt[i] = getattr(self.opt['properties_object'], i)<br>but not like this:<br>                    for i in self.opt['properties'].keys():<br>
                        setattr(self, opt[i],  getattr(self.opt['properties_object'], i))<br clear="all">-Alex Goretoy<br><a href="http://www.goretoy.com">http://www.goretoy.com</a><br><br>
<br><br><div class="gmail_quote">On Sun, Mar 15, 2009 at 6:41 PM, MRAB <span dir="ltr"><<a href="mailto:google@mrabarnett.plus.com">google@mrabarnett.plus.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">alex goretoy wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
ok now for the final result, i decided to split options out to a separate dict of lists, does this look right to every one, I currently have error somewhere else in my code so can't test this right now, Is this a good method to do this? or is there another option?<br>

<br>
</blockquote></div>
[snip]<br>
First of all, *don't use "is" and "is not" to test for equality*; use "==" and "!=".<br>
<br>
When you split the options out like that you get duplication.<br>
<br>
You have, for example:<br>
<br>
    ...<br>
    "colors": ["c", "cl", "col", ...]<br>
    ...<br>
<br>
and:<br>
<br>
    ...<br>
    "imp_colors": ["c", "cl", "col", ...]<br>
    ...<br>
<br>
Couldn't you put them into one dict, something like:<br>
<br>
   ...<br>
   "colors": ("imp_colors", ["c", "cl", "col", ...])<br>
   ...<div><div></div><div class="h5"><br>
<br>
--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</div></div></blockquote></div><br>