[Tutor] advice on creating and working with a complex datastructure

Serdar Tumgoren zstumgoren at gmail.com
Tue Jul 21 14:04:18 CEST 2009


>>
>> I do not think any of these meet the criteria for inheritance. None of
>> them "is a" kind of any of the others.
>>

I refreshed on my OO terminology and I see your point -- that
composition is a more appropriate fit here than inheritance.

>> 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?

So the below are the classes names I've settled on:

class Race(object)
class Candidate(object)
class Committee(object)
class Report(object)

I haven't quite thought through the attributes for all of the classes
and how they'll interact, so I suppose that's the next phase. I'm sure
I'll post back as I work through it. Meantime, many thanks to all for
the help. As always, I'm wowed by speed and variety of responses.

Regards,
Serdar


More information about the Tutor mailing list