What's the use of module spaces? (was Re: Circular Inheritance)

Bob Gailer bgailer at alum.rpi.edu
Wed Jul 2 16:53:57 EDT 2003


At 02:43 PM 7/2/2003 -0500, Ian Bicking wrote:

>On Wed, 2003-07-02 at 10:03, Aahz wrote:
> > In article <mailman.1057124943.21695.python-list at python.org>,
> > Ian Bicking  <ianb at colorstudy.com> wrote:
> > >
> > >You might encounter less problems if those classes go together in a
> > >single module, but module boundaries are just there to help the
> > >programmer organize code, they have little formal meaning.
> >
> > That's not true.  Modules define a namespace, and Python's execution
> > model makes heavy use of the "global" (read, current module's) namespace
> > for name resolution.
>
>Certainly modules have considerable *semantics* and effect execution.
>But they have little *meaning*.  There's all sorts of semantics
>associated with classes, but that's incidental to the meaning of a class
>-- a class is a set up behaviors common to a kind of object.  A module
>is just a pile of stuff the programmer likes to keep together.  It's
>essentially a clerical feature.

Reminds me of the question: "What's the function of mortar." Most will say 
"To hold bricks together." But it ALSO keeps them apart!

I prefer to think of modules as a tool to keep various parts of a complex 
application apart, rather than having all of them in one module. This 
improves readability, maintenance and testing.

Bob Gailer
bgailer at alum.rpi.edu
303 442 2625
-------------- next part --------------

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.492 / Virus Database: 291 - Release Date: 6/24/2003


More information about the Python-list mailing list