Reputation: 3994
Instead of:
from .model import Foo, Bar
I would like to:
import .model
This raises a syntax error. Is there a way to do it?
Upvotes: 7
Views: 470
Reputation: 22314
Anything following an import
keyword must be a valid Python name as it will be added to your scope under that same name.
Instead, do the following.
from . import model
Upvotes: 7