pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/MagicStack/asyncpg/pull/1129

ts/global-0bd78641c0a1f3e0.css" /> Refactor exception classes by bryanforbes · Pull Request #1129 · MagicStack/asyncpg · GitHub
Skip to content

Refactor exception classes#1129

Open
bryanforbes wants to merge 1 commit intoMagicStack:masterfrom
bryanforbes:feature/refactor-exceptions
Open

Refactor exception classes#1129
bryanforbes wants to merge 1 commit intoMagicStack:masterfrom
bryanforbes:feature/refactor-exceptions

Conversation

@bryanforbes
Copy link
Copy Markdown
Collaborator

  • Moved PostgresMessageMeta and PostgresMessage into their own file to make it easier to add typings later on
  • Re-exported PostgresMessageMeta and PostgresMessage from asyncpg.exceptions._base to maintain backwards compatibility
  • Removed import asyncpg statements and import within methods to prevent circular imports

* Moved `PostgresMessageMeta` and `PostgresMessage` into their own file
  to make it easier to add typings later on
* Re-exported `PostgresMessageMeta` and `PostgresMessage` from
  `asyncpg.exceptions._base` to maintain backwards compatibility
* Removed `import asyncpg` statements and import within methods to
  prevent circular imports
import sys
import textwrap
# PostgresMessageMeta imported for backward compatibility
from ._postgres_message import ( # noqa: F401
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can add them to __all__. Then you won't need as and noqa.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I do that, then they will be imported with from ._base import * in asyncpg/exceptions/__init__.py, and then they will be accessible as asyncpg.PostgresMessage and asyncpg.PostgresMessageMeta

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point.

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.

3 participants

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy