[Email-SIG] PEP 8 module names for email 3.1?

Barry Warsaw barry at python.org
Wed Feb 8 20:47:02 CET 2006


For a while now, I've been wanting to migrate the email package to PEP 8
modules names.  With Python 2.5 we have an opportunity to do this, while
bumping the email package version number to 3.1.  We'd have to do this
in a backward compatible way of course, for at least one Python release.

Most new names would map pretty obviously, just by lowercasing them.
For example email.Charset would become email.charset and
email.FeedParser would become email.feedparser.

I'd like to do something differently for the MIME* modules.  For those,
I'm thinking about creating an email.mime subpackage and populating that
with the package names, sans the 'MIME' prefix.  So email.MIMEMultipart
would become email.mime.multipart and email.NonMultipart would become
email.mime.nonmultipart.  As per PEP 8, none of the class names inside
those modules would need to change.

So first the question is whether anyone else would like to see this.  If
the answer to that is "yes", then the next question is, what's the best
way to accomplish this while retaining the existing API for backward
compatibility?

We can't just include both the legacy and lowercase Python files in the
same directory, because on case-insensitive file systems they'd
actually /be/ the same files.  I'm not sure if we can play sufficient
import hook hacks to make it work, and I'm uncomfortable with just
importing everything in the __init__.py and playing mapping games in
sys.modules.

So if you'd like to see this happen, do you have suggestions for
efficiently doing the mapping?

-Barry

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 307 bytes
Desc: This is a digitally signed message part
Url : http://mail.python.org/pipermail/email-sig/attachments/20060208/0e712bd2/attachment.pgp 


More information about the Email-SIG mailing list