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

Lazy postgresql.exceptions #85

Open
jwp opened this issue May 18, 2017 · 2 comments
Open

Lazy postgresql.exceptions #85

jwp opened this issue May 18, 2017 · 2 comments

Comments

@jwp
Copy link
Contributor

jwp commented May 18, 2017

The number of classes in postgresql.exceptions adds measurable overhead to the startup time of processes importing postgresql. Constructing the exception classes upon use would eliminate this initial overhead and memory footprint (CPython types being relatively large).

@jwp
Copy link
Contributor Author

jwp commented Jun 18, 2018

Python 3.7 adds getattr/dir support to modules. This should allow a portable means for managing lazy exception creation. This should probably be a 2.0 feature that adds a 3.7 requirement.

@jwp jwp added the v2.0 label Dec 10, 2020
@jwp
Copy link
Contributor Author

jwp commented Dec 14, 2020

Might be wise to wait until https://bugs.python.org/issue12029

Exceptions could have an SQLSTATE code physical hierarchy and ABC based groups.

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

No branches or pull requests

1 participant