Skip to content

PEP 249 refers to StandardError (gone in Python 3) #2776

Closed

Description

@pchemguy

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.

Activity

  1. Rosuav commented on Aug 28, 2022

    @Rosuav
    Contributor

    Should the document say "must be a subclass of Exception" or just drop that requirement altogether?

  2. CAM-Gerlach commented on Aug 28, 2022

    @CAM-Gerlach
    Member

    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.

  3. malemburg commented on Aug 29, 2022

    @malemburg
    Member
  4. Rosuav commented on Aug 29, 2022

    @Rosuav
    Contributor

    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.

  5. self-assigned this
    on Aug 29, 2022
  6. added a commit that references this issue on Sep 2, 2022
    c004fe8
  7. added a commit that references this issue on Sep 6, 2022
    7703958
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions