Unification of Methods and Functions

Greg Ewing greg at cosc.canterbury.ac.nz
Mon May 24 23:31:49 EDT 2004


David MacQuigg wrote:
> My perspective may be different, because I have not yet absorbed the
> Python traditions, and I don't have any instictive avoidance of static
> methods.

Are you coming at this from a Java perspective? In Java
(and in C++ until recently) you're forced to use static
methods, because the class is the only kind of namespace
available.

But Python has modules for use as general-purpose
namespaces. Classes are thus relieved of the burden
of performing this double duty, leaving them free to
concentrate on what they do best, which is defining
the behaviour of a collection of objects.

I really recommend that you *use* Python for long
enough to get a good feel for it, before attempting
to revise it. Trying to reform something that you
don't thoroughly understand is fraught with danger.

-- 
Greg Ewing, Computer Science Dept,
University of Canterbury,	
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg




More information about the Python-list mailing list