Sharing method code between class instances

Peter Hansen peter at engcorp.com
Fri Jan 24 16:41:59 EST 2003


Jp Calderone wrote:
> 
> On Fri, Jan 24, 2003 at 10:19:53AM -0600, Larry Bates wrote:
> > I have a question about how to share code between classes.  I've searched
> > and just can't find anything that is clear enough for me to understand.
> >
> > Consider: I have a simple class that will hold a field and formatting
> > (and eventually much more) information.
> >
> > [snip]
> 
>   Code first.  Test second.  Profile third.  Optimize last.

Or, better yet, Test First, Code Second, Pass Test, Write another Test, 
Run it and Watch it Fail, Write a Little More Code, Pass Test, Write 
Another Failing Test, and so on....

It's called Test-Driven Development and it beats the pants off the 
Code First Test Second approach which I've seen used on so many projects, 
where No Time to Test became the situation just prior to the ship date, 
that I refuse ever to work that way again.

;-)

-Peter




More information about the Python-list mailing list