"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  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to