[Python-Dev] On breaking modules into packages Was: [issue10199] Move Demo/turtle under Lib/

Brett Cannon brett at python.org
Wed Nov 3 03:50:11 CET 2010


On Tue, Nov 2, 2010 at 16:43, Guido van Rossum <guido at python.org> wrote:
> On Tue, Nov 2, 2010 at 4:39 PM, Michael Foord <fuzzyman at voidspace.org.uk> wrote:
>> As the maintainer of unittest I'd like to say that in the absence of clear
>> consensus that the merger should happen, or a fiat from the BDFL, the merger
>> won't happen. I believe that this is standard Python development process.
>
> I don't think that anybody seriously expected the unittest package
> would be restructured again. The remaining thrust of the thread seems
> to be whether PEP 8 should advise against breaking code up into many
> little modules. Personally I don't think it should -- it should by now
> be clear that this is not an area where one style will fit all. I also
> think that the convenience of one style over another might have
> something to do with the tools being used.

This is not what I am suggesting for PEP 8. I want to say that a
package's file structure should reflect the public API. I personally
have no trouble with modules in packages that do not have a ton of
objects in them. I just think if you have pkg/mod.py, pkg.mod should
be exposed in the API, else name the file _mod.py. In the case of
unittest that would just mean documenting that it's
unittest.case.TestCase and that unittest.TestCase is for legacy
reasons, much like os.path is just blindly added on to os even though
it is a separate module(s).


More information about the Python-Dev mailing list