Skip to content

Conversation

@andresdelfino
Copy link
Contributor

No description provided.



.. exception:: error
.. exception:: Error
Copy link
Member

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

cpython/Lib/copy.py

Lines 55 to 57 in 2aabc32

class Error(Exception):
pass
error = Error # backward compatibility

Copy link
Contributor Author

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?

Copy link
Member

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

Copy link
Member

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.

Copy link
Member

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.

@miss-islington
Copy link
Contributor

Thanks @andresdelfino for the PR, and @orsenthil for merging it 🌮🎉.. I'm working now to backport this PR to: 3.9.
🐍🍒⛏🤖

@miss-islington
Copy link
Contributor

Thanks @andresdelfino for the PR, and @orsenthil for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Apr 26, 2021
(cherry picked from commit 0d930f1)

Co-authored-by: Andre Delfino <adelfino@gmail.com>
@orsenthil orsenthil self-assigned this Apr 26, 2021
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Apr 26, 2021
(cherry picked from commit 0d930f1)

Co-authored-by: Andre Delfino <adelfino@gmail.com>
orsenthil pushed a commit that referenced this pull request Apr 26, 2021
(cherry picked from commit 0d930f1)

Co-authored-by: Andre Delfino <adelfino@gmail.com>

Co-authored-by: Andre Delfino <adelfino@gmail.com>
orsenthil pushed a commit that referenced this pull request Apr 26, 2021
(cherry picked from commit 0d930f1)

Co-authored-by: Andre Delfino <adelfino@gmail.com>
@andresdelfino andresdelfino deleted the fix_casing branch April 26, 2021 01:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir skip issue skip news

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants