[Tutor] advice on creating and working with a complex datastructure
Alan Gauld
alan.gauld at btinternet.com
Tue Jul 21 01:05:37 CEST 2009
"Serdar Tumgoren" <zstumgoren at gmail.com> wrote
> Aha, okay, the multiple classes approach makes sense. But would these
> be nested classes,
No although they would probably have attributes containing
the related lists. Thus Race might have a list of Candidates.
And Candidate would have a list of Committees etc.
> perhaps inheriting attributes from their parent
> classes? E.g.:
I do not think any of these meet the criteria for inheritance.
None of them "is a" kind of any of the others.
> class Race
>
> class Candidate
>
> class Committee
>
> class Filing
I don;t like the use of Filing for a class name, it sounds like
a collection and in Python we don;t usually need to crteate
collection classes, we can just use a standard collection type.
Maybe File would be better although it could be confused
with a comuter file... Maybe Record would be best?
HTH
Alan G.
More information about the Tutor
mailing list