I noticed Flask was using Werkzeug to __import__
a module, and I was a little confused. I went and checked out the docs on it and saw that it seems to give you more control somehow in terms of where it looks for the module, but I'm not sure exactly how and I have zero idea how it's different from importlib.import_module
.
The odd thing in the Werkzeug example is that it just says __import__(import_name)
, so I don't see how that's any different from just using the import
statement, since it's ignoring the optional extra parameters.
Can anyone explain? I looked at other people having asked similar questions on SO previously but they weren't very clearly phrased questions and the answers didn't address this at all.