Dynamically creating class properties

2007-10-04 Thread Karlo Lozovina
Hi all, this is my problem: lets say I have a arbitrary long list of attributes that I want to attach to some class, for example: l = ['item1', 'item2', 'item3'] Using metaclasses I managed to create a class with those three attributes just fine. But now I need those attributes to be

Re: Dynamically creating class properties

2007-10-04 Thread Paul Hankin
On Oct 4, 9:59 pm, Karlo Lozovina [EMAIL PROTECTED] wrote: Hi all, this is my problem: lets say I have a arbitrary long list of attributes that I want to attach to some class, for example: l = ['item1', 'item2', 'item3'] Using metaclasses I managed to create a class with those three

Re: Dynamically creating class properties

2007-10-04 Thread Paul Hankin
On Oct 4, 11:55 pm, Paul Hankin [EMAIL PROTECTED] wrote: On Oct 4, 9:59 pm, Karlo Lozovina [EMAIL PROTECTED] wrote: Hi all, this is my problem: lets say I have a arbitrary long list of attributes that I want to attach to some class, for example: l = ['item1', 'item2', 'item3']

Re: Dynamically creating class properties

2007-10-04 Thread Michael Spencer
Karlo Lozovina wrote: Any idea how to do that with metaclasses and arbitrary long list of attributes? I just started working with them, and it's driving me nuts :). Thanks for the help, best regards. Try implementing a property factory function before worrying about the metaclass.