Thanks everybody for all the suggestions and ideas. I still did not have time to look them all over, but I will. Thanks again!
Best, Guilherme On Thu, Jan 14, 2010 at 4:52 AM, Alan Gauld <alan.ga...@btinternet.com> wrote: > > "Guilherme P. de Freitas" <guilhe...@gpfreitas.com> wrote > >> Here is my problem. I have two classes, 'Body' and 'Member', and some >> attributes of 'Body' can be of type 'Member', but some may not. The >> precise attributes that 'Body' has depend from instance to instance, >> and they can be added or deleted. I need any instance of 'Body' to >> keep an up-to-date list of all its attributes that belong to the class >> 'Member'. How do I do this? > > Check the type of the attribute? Using isinstance()? > > I'm not sure of the rationale - why it needs to know the type etc > But isinstance is the most obvious way that I can think of. > > Alan G. > > _______________________________________________ > Tutor maillist - tu...@python.org > To unsubscribe or change subscription options: > http://mail.python.org/mailman/listinfo/tutor > -- Guilherme P. de Freitas http://www.gpfreitas.com _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor