Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

email module namespace inconsistent #40457

Closed
melicertes mannequin opened this issue Jun 25, 2004 · 2 comments
Closed

email module namespace inconsistent #40457

melicertes mannequin opened this issue Jun 25, 2004 · 2 comments
Assignees
Labels
stdlib Python modules in the Lib dir

Comments

@melicertes
Copy link
Mannequin

melicertes mannequin commented Jun 25, 2004

BPO 980019
Nosy @warsaw

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = 'https://github.com/warsaw'
closed_at = <Date 2004-06-26.03:41:04.000>
created_at = <Date 2004-06-25.21:28:11.000>
labels = ['invalid', 'library']
title = 'email module namespace inconsistent'
updated_at = <Date 2004-06-26.03:41:04.000>
user = 'https://bugs.python.org/melicertes'

bugs.python.org fields:

activity = <Date 2004-06-26.03:41:04.000>
actor = 'barry'
assignee = 'barry'
closed = True
closed_date = None
closer = None
components = ['Library (Lib)']
creation = <Date 2004-06-25.21:28:11.000>
creator = 'melicertes'
dependencies = []
files = []
hgrepos = []
issue_num = 980019
keywords = []
message_count = 2.0
messages = ['21316', '21317']
nosy_count = 2.0
nosy_names = ['barry', 'melicertes']
pr_nums = []
priority = 'low'
resolution = 'not a bug'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue980019'
versions = ['Python 2.3']

@melicertes
Copy link
Mannequin Author

melicertes mannequin commented Jun 25, 2004

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?

@melicertes melicertes mannequin closed this as completed Jun 25, 2004
@melicertes melicertes mannequin added the invalid label Jun 25, 2004
@melicertes melicertes mannequin closed this as completed Jun 25, 2004
@melicertes melicertes mannequin assigned warsaw Jun 25, 2004
@melicertes melicertes mannequin added the invalid label Jun 25, 2004
@melicertes melicertes mannequin assigned warsaw Jun 25, 2004
@melicertes melicertes mannequin added stdlib Python modules in the Lib dir labels Jun 25, 2004
@warsaw
Copy link
Member

warsaw commented Jun 26, 2004

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()

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir
Projects
None yet
Development

No branches or pull requests

1 participant