-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
bpo-40899: Document exception raised when module cannot be imported #27709
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Note Ronald's comment on arbitrary exceptions being raised from a module body while it's being imported.
- Please don't insert error handling information in the leading paragraph. Look at other functions in functions.rst, they have exception information listed further in the text, usually as the last paragraph describing them.
while I've Approved this change from the standpoint of not being a bad thing to document, I do think the above should be addressed first. |
This PR is stale because it has been open for 30 days with no activity. |
@meowmeowmeowcat This has been awaiting changes for over a year. Are you planning to finish this or shall we close it so someone else can pick it up? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #27709 (comment).
I am going to finish this. Sorry for the late response! I have made the requested changes; please review again |
Co-authored-by: Irit Katriel <[email protected]>
An :exc:`ImportError` exception can be raised if the module cannot be imported | ||
successfully. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I like this wording - what do you mean "can be raised", it sounds like it is possible for import to fail and not raise an exception.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note Ronald's comment on arbitrary exceptions being raised from a module body while it's being imported.
It means arbitrary exceptions can also be raised.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand the intent, but I don't think that's the only possible interpretation of the current wording.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just found out that #94662 is also doing the same thing. Would you prefer that one?
https://bugs.python.org/issue40899