-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Description
When MyPy encounters star (*) imports it considers every symbol defined in the given module as being imported even if an __all__ attribute is present on the module.
For example, say you have mypkg with two files, main.py:
from datetime import datetime
from mypkg.widgets import *and widget.py:
from datetime import datetime
__all__ = [
"Gadget"
]
class Gadget(object):
passRunning "mypy mypkg/app.py" issues the following error: "mypkg/app.py:2: error: Name 'datetime' already defined", though datetime should not be re-imported to the app module.
Metadata
Metadata
Assignees
Labels
No labels