Skip to content

Add six.moves types for email_mime sources. - #2902

Merged
srittau merged 2 commits into
python:masterfrom
joshuamorton:new_email
Apr 8, 2019
Merged

srittau merged 2 commits into
python:masterfrom
joshuamorton:new_email

Conversation

@joshuamorton

Copy link
Copy Markdown
Contributor

As a followup to the work done in #2767 and #2830, and to address a
piece of #66, most of the email_mime submodules aren't typed in six
under python2, only python3. Now they are.

Joshua Morton added 2 commits April 8, 2019 08:26
As a followup to the work done in python#2767 and python#2830, and to address a
piece of python#66, most of the email_mime submodules aren't typed in six
under python2, only python3. Now they are.
It looks like internally the stdlib typeshed reflects the python3 source
layout, and the python2 imports are dynamically generated. Stubs now
reflect that.

@srittau srittau left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, the imports you use do not exist yet as stubs, since email is also incomplete. You either need to fix that (by importing the modules in stdlib/2/email/__init__.pyi or import the more modern modules in six, e.g. email.mime.multipart, which do exist as stubs.

@joshuamorton

Copy link
Copy Markdown
Contributor Author

Should be fixed now.

Although I guess I don't need six at all, since this means I can import from the new paths in py2 and py3. Good to know :)

@srittau
srittau merged commit d46d36b into python:master Apr 8, 2019
@srittau

srittau commented Apr 8, 2019

Copy link
Copy Markdown
Collaborator

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants