[getopt-sig] RE: [Python-Dev] Re: Adding Optik to the standard library

Patrick K. O'Brien pobrien@orbtech.com
Thu, 30 May 2002 22:10:46 -0500


[Barry A. Warsaw]
> If that's so, then I'd prefer to see each class in its own module
> inside a parent package.

Without trying to open a can of worms here, is there any sort of consensus
on the use of packages with multiple smaller modules vs. one module
containing everything? I'm asking about the Python standard library,
specifically. According to the one-class-per-module rule of thumb, there are
some Python modules that could be refactored into packages. Weighing against
that is the convenience of importing a single module.

I'm just wondering if there are any guidelines that should frame one's
thinking beyond the fairly obvious ones? For example, is the standard
library an exceptional case because it must appeal to new users as well as
experts? Does a good part of this issue come down to personal preference? Or
are there advantages and disadvantages that should be documented? (Maybe
they already have.)

Is the current library configuration considered healthy? There are a mix of
packages and single modules. Are these implementations pretty optimal, or
would they be organized differently if one had the chance to do it all over
again?

Just curious.

---
Patrick K. O'Brien
Orbtech