[Tutor] Difference between a class & module?

Derek Pienaar derekp at sentechsa.co.za
Fri Jul 2 15:04:36 EDT 2004


Halo Guys.

I need to clear up some confusion regarding a class and a module.

This question came up when I saw an example in "a byte of python"
tutorial, where the join method was used, but (as I saw it)  without 
importing the string module (as I understood it).

I thought that some frequently used "modules" were built-in and that
string was one of them... not so.

I understand what a class does ... among other things, it mainly defines
or is a template for an object. I understand the concept of objects & 
instances but thought that a module was exactly the same as a class.

To my surprise, I heard it not to be so. What then is a module? Please
try and keep the explanation plain and simple if possible :-)

Thanks in advance.

Derek



More information about the Tutor mailing list