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

Barry Warsaw barry at python.org
Fri Oct 29 16:35:00 CEST 2010


On Oct 27, 2010, at 10:34 AM, R. David Murray wrote:

To put your mind at ease, Barry, I'd not want to do that either :)

Phew! But I wasn't worried, 'cause I know you're not insane. (Though the fact that you've effectively inherited the email package does bring that into question. :)

But by (IMO good) design Generator, FeedParser, and Message are all supposed to be independent (use only each other's public APIs). And Header can be (and is, I think) used without the other pieces of email, as is true for other of the helper modules (base64mime, quoprimime, etc).

Agreed.

On the other hand, I have no clue why 'iterators.py' exists :)

They're there for some corner use cases, but they do tend to be helpful. body_line_iterator() is probably the one I've used the most. The iterators are intended to be used independently.

The one that bugs me most, though, is MIME. Combining all the mime stuff into one file seems like it would be a big win (not that it's possible, now). What is the benefit of email.mime.text.MIMEText over email.mime.MIMEText, when each of the files in the mime package consists of a single subclass?

I think you're right that the extra level of module path is probably unnecessary. I'm not sure that means all the .py files in email/mime should be combined though. OTOH, wc -l Lib/email/mime/*.py is only 314 lines so I'm happy to defer to you on that.

So, to clarify, like Raymond I'm not saying that packages are always bad. I'm just saying that packages are also not always good; and, further, that the number of lines of code in a file should, IMO, have nothing to do with the decision as to whether or not to create a package.

+1 -Barry -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: not available URL: <http://mail.python.org/pipermail/python-dev/attachments/20101029/411e92b7/attachment.pgp>



More information about the Python-Dev mailing list