[ python-Bugs-980019 ] email module namespace inconsistent

SourceForge.net noreply at sourceforge.net
Fri Jun 25 23:41:05 EDT 2004


Bugs item #980019, was opened at 2004-06-25 17:28
Message generated for change (Comment added) made by bwarsaw
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=980019&group_id=5470

Category: Python Library
Group: Python 2.3
>Status: Closed
>Resolution: Invalid
Priority: 3
Submitted By: Charles (melicertes)
Assigned to: Barry A. Warsaw (bwarsaw)
Summary: email module namespace inconsistent

Initial Comment:
Inconsistencies in the email module:

----------------
from email.Generator import Generator
foo = Generator(...)
----------------

works as you'd expect, but the following:
----------------
import email
foo = email.Generator.Generator(...)
----------------
raises AttributeError: 'module' object has no attribute
'Generator'.

The two should be equivalent, shouldn't they?



----------------------------------------------------------------------

>Comment By: Barry A. Warsaw (bwarsaw)
Date: 2004-06-25 23:41

Message:
Logged In: YES 
user_id=12800

That's not the way Python works, and the email package isn't
like os here; it doesn't automatically export its
sub-modules.  You'll need to do this:

import email.Generator
foo = email.Generator.Generator()


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=980019&group_id=5470



More information about the Python-bugs-list mailing list