-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
[doc] Fix copy.Error casing #22004
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
[doc] Fix copy.Error casing #22004
Conversation
@@ -27,7 +27,7 @@ Interface summary: | |||
Return a deep copy of *x*. | |||
|
|||
|
|||
.. exception:: error | |||
.. exception:: Error |
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: error is an alias for Error although Error is present in __all__
too
Lines 55 to 57 in 2aabc32
class Error(Exception): | |
pass | |
error = Error # backward compatibility |
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.
@tirkarthi If "error" is a backward compatibility wart, we should be documenting Error instead, right?
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 was under the impression that with that comment Python 2 only had error and not Error. But the same alias is present in Python 2 too. So I guess it predates something more than 2.7. I agree with the change over documenting Error. I will wait for another core dev opinion. The git blame is as below :
227b1204681 (Fred Drake 2000-08-17 05:06:49 +0000 55) class Error(Exception):
88869f9787c (Tim Peters 2001-01-14 23:36:06 +0000 56) pass
88869f9787c (Tim Peters 2001-01-14 23:36:06 +0000 57) error = Error # backward compatibility
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.
Documenting Error
seems alright and seems more modern usage to me. +1 with this change.
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.
Given Error
is exposed via __all__
interface, it is accurate to update the documentation to reflect that.
Thanks @andresdelfino for the PR, and @orsenthil for merging it 🌮🎉.. I'm working now to backport this PR to: 3.9. |
Thanks @andresdelfino for the PR, and @orsenthil for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8. |
(cherry picked from commit 0d930f1) Co-authored-by: Andre Delfino <adelfino@gmail.com>
(cherry picked from commit 0d930f1) Co-authored-by: Andre Delfino <adelfino@gmail.com>
No description provided.