NEWBIE: What's the instance name?
gagenellina at softlab.com.ar
Mon Dec 29 23:44:59 CET 2003
At 29/12/2003 11:03, you wrote:
>Some of the classes have a common (or near common) display routine,
>others are totally different. If I use lx.display(), the display code
>has to be contained as a method in each class. I chose, for ease of
>maintenance, to make a display module with all the display routines
>gathered together in one spot. . In the event a future programmer
>decided to make a change to the display routine for a given class, or
>needed to add a class/display, I feel there's less chance of his/her
>messing up the UPCA-like classes. I guess I'm a believer in
>classes/methods doing a limited number of things, and doing them well.
>Is that a C hang-over?
You could define anyway a display() method in each class, and delegate the
implementation to another module:
More information about the Python-list