Class vrs. function

Bob van der Poel bvdpoel at uniserve.com
Sat Jul 1 22:56:34 EDT 2000


Paul Prescod wrote:
> 
> Bob van der Poel wrote:
> >
> > ...
> >
> > Is this just a good habit being developed by those who think that
> > classes are better than functions, or god forbid, inline code?
> 
> Given what you've said, that one-function class looks pretty bizarre. Is
> there maybe something else useful about it that you haven't noticed?
> Classes are not better than functions. They are just different. In most
> cases, you use classes when you need to combine data and instructions.

Yes, that I understand. In some of the example code I've seen there is
only the __init__ function and no data. That's why it doesn't make sense
to me. Maybe I'm just having a bad day.....

-- 
   __
  /  )      /         Bob van der Poel
 /--<  ____/__        bvdpoel at uniserve.com
/___/_(_) /_)         http://users.uniserve.com/~bvdpoel



More information about the Python-list mailing list