What are modules really for?

Brian Quinlan brian at sweetapp.com
Thu Aug 11 09:42:20 EDT 2005


N.Davis wrote:
> Functions existing in a module? Surely if "everything is an object" 
 > (OK thats Java-talk but supposedly Python will eventually follow this
 > too)

There is a difference between everything being an object and everything 
being an instance of a class. In Python, every runtime entity is an 
object but not everything is a class instance. In Java, there are 
runtime-accessable entities that are neither objects nor class instances.

> then there should be nothing in a module thats not part of a class. Even 
> a static method is simply a class function that operates on the 
> "collection of all instances" rather than a single instance.

Really? What instances do the static methods in the Java Math class 
operate on? Not Math instances, of course. So what is the rational for 
them being packaged in the Math class?

Cheers,
Brian



More information about the Python-list mailing list