Tree views - Best design practices

Terry Reedy tjreedy at udel.edu
Thu Jan 8 14:40:24 EST 2009


Filip Gruszczyński wrote:
>>>>> class Element(object):
>>        operations = "Element operations"
>>
>>
>>>>> class Group(object):
>>        operations = "Group operations"
>>
>>
>>>>> e = Element()
>>>>> g = Group()
>>>>>
>>>>> e.operations
>> 'Element operations'
>>>>> g.operations
>> 'Group operations'
> 
> But this is the same as asking for a class,

The point is to put (and use) the information about what operations 
apply to instances in each class rather than in an external function.




More information about the Python-list mailing list