class vs function ???

Rainer Deyke rainerd at eldwood.com
Sat Feb 21 13:52:28 EST 2004


Gaurav Veda wrote:
> What is the difference between a class and a function in Python ???

Functions and classes are both callable objects.  Calling a function
executes the body of the function; calling a class creates and returns an
instance of the class.

> Waiting for some 'logical' explanation !!!

I'm not sure to explain.  How does the output differ from what you expected?


-- 
Rainer Deyke - rainerd at eldwood.com - http://eldwood.com





More information about the Python-list mailing list