Structure

Chris Lyon chris.lyon at tgm.co.uk
Fri Sep 13 03:42:13 EDT 2002


I have a set of related classes each are derived from the others in a
tree.
I then produce multiple instances of the different classes.
I wish to edit the properties of the instances and add extra
properties specifically depending on which class they are derived
from.
Is there a standard python approach to constructing this sort of
structure.

My classes are defined in one module, and the display elements are in
a seperate module, since this seems to allow maximum flexibility. So I
am using a dictionary with the name as the key and a tuple of display
text, sort order, type of data. So for instance when I set background
colour I wish to allow the edit facility to choose from a colour
selection dialog etc.

Since the overall structure is pickled, is there a general structure
that allows me not to store a dictionary for every instance, I seem to
be developing a seperate tree of classes for these definitions but my
display components would seem to want to appear in my 'main' module
and I feel my present approach will lead to loosing the flexibility
that modules seeem to provide.

Chris



More information about the Python-list mailing list