```python from email.charset import SHORTEST ``` Causes `mypy` to complain: `Module 'email.charset' has no attribute 'SHORTEST'` However: ``` $ python >>> from email.charset import SHORTEST >>> SHORTEST 3 ```
Activity
jolaf commentedon Mar 7, 2019
Probably the cause is a bug in Python documentation:
https://bugs.python.org/issue33449
srittau commentedon Mar 7, 2019
This affects only the Python 2 stubs. Patches welcome!
jolaf commentedon Mar 7, 2019
Nope, I've actually encountered the problem with Python 3.
srittau commentedon Mar 7, 2019
It was fixed in #2768 for Python 3, but the Python 2 version still needs this fix.
jolaf commentedon Mar 11, 2019
Here's the patch for Python 2: #2854
Add email.charset.SHORTEST, QP, BASE64 to the stub for Python 2 (#2857)
Add six.moves types form email_mime sources.
Add six.moves types for email_mime sources. (#2902)