How to import only one module in a package when the package __init__.py has already imports the modules?

Robert Kern robert.kern at gmail.com
Sun Nov 1 01:32:38 CET 2009


On 2009-10-31 19:21 PM, Wolodja Wentland wrote:
> On Sat, Oct 31, 2009 at 18:29 -0500, Peng Yu wrote:

>> And I always put a single class in a file.
>
> Why? What do you gain by that?

While it's never a good idea to follow the rule slavishly, it's often a good 
idea. Many classes are themselves a semantic unit of functionality enough to 
justify their own module. I've certainly seen the rule overapplied, though.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco




More information about the Python-list mailing list