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

Michael Foord fuzzyman at voidspace.org.uk
Wed Nov 3 01:02:37 CET 2010


On 02/11/2010 23:34, Michael Foord wrote:
> On 02/11/2010 23:00, Brett Cannon wrote:
>> On Tue, Nov 2, 2010 at 15:47, Raymond Hettinger
>> <raymond.hettinger at gmail.com>  wrote:
>>> On Nov 1, 2010, at 7:35 PM, Brett Cannon wrote:
>>>
>>> I think the issue here is that the file structure of the code no
>>> longer matches the public API documented by unittest. Personally I,
>>> like most people it seems, prefer source files to be structured in a
>>> way to match the public API. In the case of unittest Michael didn't.
>>> He did ask python-dev if it was okay to do what he did, we all kept
>>> quiet, and now we have realized that most of us prefer to have files
>>> that mirror the API; lesson learned. But Python 2.7 shipped with this
>>> file layout so we have to stick with it lest we break any imports out
>>> there that use the package-like file structure Michael went with
>>> (which we could actually document and use if we wanted now that
>>> Michael has already broken things up). Reversing the trend by sticking
>>> all the code into unittest/__init__.py and then sticking import shims
>>> into the existing modules would be a stupid waste of time, especially
>>> considering the head maintainer of the package likes it the way it is.
>>>
>>> I'm not sure I follow where we're stuck with the current package.
>>> AFAICT, the module is still used with "import unittest".
>> Yes, as far as you can tell, but who the hell knows what someone is
>> doing with code you are *not* aware of. As I said, Python 2.7 shipped
>> with the code structured like this, so it's possible someone is
>> importing unittest.case.TestCase instead of unittest.TestCase.
>>
>
> It is also shipped in unittest (and unittest2py3k I might add) so that 
> users of earlier versions of Python can use the new features 
> seamlessly. (unittest2 will be in Django 1.3.)

unittest2 dammit.

Michael

-- 

http://www.voidspace.org.uk/

READ CAREFULLY. By accepting and reading this email you agree,
on behalf of your employer, to release me from all obligations
and waivers arising from any and all NON-NEGOTIATED agreements,
licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap,
confidentiality, non-disclosure, non-compete and acceptable use
policies (”BOGUS AGREEMENTS”) that I have entered into with your
employer, its partners, licensors, agents and assigns, in
perpetuity, without prejudice to my ongoing rights and privileges.
You further represent that you have the authority to release me
from any BOGUS AGREEMENTS on behalf of your employer.



More information about the Python-Dev mailing list