[Python-Dev] Dropping __init__.py requirement for subpackages

Barry Warsaw barry at python.org
Thu Apr 27 04:42:55 CEST 2006


Boy, threads here sure move fast when there's work to be done :).
Although largely moot now, I'll follow up for posterity's sake.

On Wed, 2006-04-26 at 10:59 -0700, Guido van Rossum wrote:

> Oh, cool gray area. I propose that if there's no __init__.py it prints
> '<path>/sub1/sun2/' i.e. with a trailing slash; that causes dirname to
> just strip the '/'. (It would be a backslash on Windows of course).

Yep, that's the right thing to do.

Given all the other traffic in this thread, I don't have much more to
add except:

I probably don't remember things accurately, but ISTR that __init__.py
was added as a way to expose names in the package's namespace first.  We
probably went from that to requiring __init__.py as a way to be explicit
about what directories are packages and which aren't.  So I suspect
you're right when you say that if the rule had already been relaxed and
you were now proposing to tighten the rules, we probably get just as
many complaints.

alternative-universe-ly y'rs,
-Barry

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 309 bytes
Desc: This is a digitally signed message part
Url : http://mail.python.org/pipermail/python-dev/attachments/20060426/c6eba8e8/attachment.pgp 


More information about the Python-Dev mailing list