Skip to content
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

PEP 249: Replace StandardError with Exception #2781

Merged
merged 6 commits into from
Sep 6, 2022

Conversation

malemburg
Copy link
Member

To avoid confusion when using the DB-API 2.0 in the context of Python 3.

Add a note about a future upgrade to the Warning base class.

Fixes #2776.

the DB-API 2.0 in the context of Python 3.

Add a note about a future upgrade to the Warning base class.

Fixes python#2776.
@vstinner
Copy link
Member

vstinner commented Sep 2, 2022

cc @erlend-aasland

@vstinner
Copy link
Member

vstinner commented Sep 2, 2022

cc @methane

@Rosuav
Copy link
Contributor

Rosuav commented Sep 2, 2022

LGTM. Not sure the Py2 historical note is going to matter much but it's good to have it in case anyone's wondering as they make upgrades.

@malemburg
Copy link
Member Author

pep-0249.txt Outdated Show resolved Hide resolved
This was removed in Python 3 as well.  Python 2.7 doesn't need it either,
since all standard exceptions are builtin objects.
pep-0249.txt Outdated Show resolved Hide resolved
They were already for a very long time, so this is pointless.
I only had this sentence to explain why I had removed the
"import exceptions" line from the Python 2 days.
pep-0249.txt Outdated Show resolved Hide resolved
pep-0249.txt Outdated Show resolved Hide resolved
pep-0249.txt Outdated Show resolved Hide resolved
@malemburg malemburg merged commit 7703958 into python:main Sep 6, 2022
@malemburg
Copy link
Member Author

Thank you all for your reviews.

@CAM-Gerlach
Copy link
Member

Late to the party, was busy with the Artemis 1 launch, but just FYI as of #2702 you can now use intersphinx links to be able to do e.g. :exc:`Exception`, etc, which will not only format it as an exception, but also link to the relevant exception, if you want.

@malemburg
Copy link
Member Author

malemburg commented Sep 14, 2022 via email

@CAM-Gerlach
Copy link
Member

Yup, its standard Sphinx reST; PEP-12 both gives an intro to reST as well as PEP-specific guidance, but per #2337 I've been meaning to update it to focus just on the latter and for the rest, refer to the more complete and up to date Sphinx reST primer (which itself is just a mildly updated version of the reST primer in the CPython devguide, not to be confused with the earlier and more limited docutils reST primer). There's also the docutils Quick Reference and full reference to basic reST, and the Sphinx Directives, Domains and Roles pages for the constructs Sphinx adds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PEP 249 refers to StandardError (gone in Python 3)
8 participants