This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: email module namespace inconsistent
Type: Stage:
Components: Library (Lib) Versions: Python 2.3
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: barry Nosy List: barry, melicertes
Priority: low Keywords:

Created on 2004-06-25 21:28 by melicertes, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg21316 - (view) Author: Charles (melicertes) Date: 2004-06-25 21:28
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?

msg21317 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2004-06-26 03:41
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()
History
Date User Action Args
2022-04-11 14:56:05adminsetgithub: 40457
2004-06-25 21:28:11melicertescreate