Setting an attribute without calling __setattr__()

Aahz aahz at pythoncraft.com
Sat Apr 26 11:44:38 EDT 2008


In article <m27ielb2i8.fsf at googlemail.com>,
Arnaud Delobelle  <arnodel at googlemail.com> wrote:
>Joshua Kugler <jkugler at bigfoot.com> writes:
>>
>>             self.me = []
>>             for v in obj:
>>                 self.me.append(ObjectProxy(v))
>
>Note that is could be spelt:
>
>self.me = map(ObjectProxy, v)

It could also be spelt:

self.me = [ObjectProxy(v) for v in obj]

which is my preferred spelling....
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

Why is this newsgroup different from all other newsgroups?  



More information about the Python-list mailing list