pydoc.safeimport: Use importlib.import_module instead of __import__#103118
pydoc.safeimport: Use importlib.import_module instead of __import__#103118brettcannon merged 1 commit intopython:mainfrom
Conversation
|
Can I get a reviewer assigned? |
|
@iritkatriel (as a more-than-once committer into |
That’s not how it works. @arhadthedev - having committed to a script is not a good indication of ability to review any change in it. I’m less concerned about being spammed with inappropriate review requests, than about creating false expectations among contributors who do not understand how this goes. In this case it would be better to first reset the OP’s expectations about our process. If you are looking for a reviewer, I would start by looking for a pydoc maintainer, and if I can’t find one then an import expert. |
|
Thanks for the explanation! |
|
@brettcannon You're listed as an import expert. Could you review this? |
|
@ppwwyyxx thanks! |
Some libraries behave a bit differently:
For such modules,
safeimportfails to import the module because it tries to access the attribute "sgd". On the other hand,importlib.import_modulecan do it correctly.Using
import_modulealso simplifies code.