Factory for Struct-like classes

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Tue Aug 19 18:40:31 EDT 2008


En Tue, 19 Aug 2008 12:43:27 -0300, eliben <eliben at gmail.com> escribió:

> On Aug 18, 11:16 am, Gabriel Genellina <gagsl-... at yahoo.com.ar> wrote:
>> On 13 ago, 14:46, eliben <eli... at gmail.com> wrote:
>>
>> > On Aug 13, 7:30 pm, Christian Heimes <li... at cheimes.de> wrote:
>> > > Try named tuplehttp://code.activestate.com/recipes/500261/
>>
>> > 1) I see this is done with exec anyway, so there's no more pythonic
>> > way.
>>
>> It doesn't *have* to be done with exec - I think there are other
>> variants using metaclasses instead.
>Can you suggest an alternative, without exec ?

See these recipes: http://code.activestate.com/recipes/303439/ and 303770  
and 303481; read the comments section too.

-- 
Gabriel Genellina




More information about the Python-list mailing list