On Mon, Jul 20, 2009 at 6:05 PM, Alan Gauld <alan.ga...@btinternet.com>wrote:
> "Serdar Tumgoren" <zstumgo...@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? If the candidate can file reports, perhaps the candidate should have a member list (or some other appropriate container) called reports and a method/function called file_report? -Wayne
_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor