-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
PEP 249 refers to StandardError (gone in Python 3) #2776
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
Comments
Should the document say "must be a subclass of |
Normally, PEPs are considered historical documents, but in this special case it describes an ongoing specification, and I'm not sure there is another place this is documented (though perhaps ideally there should be). Pinging @malemburg as the PEP author and @erlend-aasland as a core dev whom I know is active with DB-API stuff to take a look at this. |
On 28.08.2022 18:52, C.A.M. Gerlach wrote:
Normally, PEPs are considered historical documents, but in this special
case it describes an ongoing specification, and I'm not sure there is
another place this is documented (though perhaps ideally there should
be). Pinging @malemburg <https://github.com/malemburg> as the PEP author
and @erlend-aasland <https://github.com/erlend-aasland> as a core dev
whom I know is active with DB-API stuff to take a look at this.
PEP 249 is an informational PEP and the documentation of a living
standard in Python. The DB-SIG still makes changes to the PEP every now
and then.
It is interesting that this difference between Python 2 and 3 wasn't
raised earlier. I could also not find any documentation on why
StandardError was removed in Python 3. There's no PEP or other
documentation explaining the reasoning. The only document mentioning the
removal is the "What's New in Python 3.0"
(https://docs.python.org/3.7/whatsnew/3.0.html).
In any case, the correct replacement in Python 3 is "Exception" and I'll
add a note to the PEP.
…--
Marc-Andre Lemburg
http://www.malemburg.com/
|
The justification for removing StandardError was basically "it ain't needed no more". From my reading of things, it looks like the removal of string exceptions also removed the need for extra types of hierarchy in class exceptions. I think the entire sentence can be dropped, actually - if it weren't there, anyone creating a database module would still use Exception as a base class, as subclassing BaseException directly is rare and not what you'd want here. |
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.
* Replace StandardError with Exception 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. * Fix typo and add year for more context. * Remove mention of the exceptions module This was removed in Python 3 as well. Python 2.7 doesn't need it either, since all standard exceptions are builtin objects. * Remove mention of exception objects being builtins. 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. * Grammar fix * Fix exception hierarchy formatting
PEP 249 / DB API 2.0 refers to the StandardError Python exception as the starting point for its exception hierarchy, but this exception is gone in Python 3.
The text was updated successfully, but these errors were encountered: