Skip to content

Commit

Permalink
Update __all__ statements to a simpler form that is better supported …
Browse files Browse the repository at this point in the history
…by typecheckers (#828)

Update __all__ statements to a simpler form that's better supported by static type checkers like pyright/pylance

https://github.com/microsoft/pyright/blob/main/docs/typed-libraries.md#library-interface
  • Loading branch information
bschnurr authored Nov 6, 2021
1 parent dad2691 commit 0a3ae7f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 2 additions & 4 deletions asyncpg/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,5 @@
from ._version import __version__ # NOQA


__all__ = (
('connect', 'create_pool', 'Pool', 'Record', 'Connection')
+ exceptions.__all__ # NOQA
)
__all__ = ('connect', 'create_pool', 'Pool', 'Record', 'Connection')
__all__ += exceptions.__all__ # NOQA
4 changes: 3 additions & 1 deletion asyncpg/exceptions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1040,7 +1040,7 @@ class IndexCorruptedError(InternalServerError):
sqlstate = 'XX002'


__all__ = _base.__all__ + (
__all__ = (
'ActiveSQLTransactionError', 'AdminShutdownError',
'AmbiguousAliasError', 'AmbiguousColumnError',
'AmbiguousFunctionError', 'AmbiguousParameterError',
Expand Down Expand Up @@ -1180,3 +1180,5 @@ class IndexCorruptedError(InternalServerError):
'WindowingError', 'WithCheckOptionViolationError',
'WrongObjectTypeError', 'ZeroLengthCharacterStringError'
)

__all__ += _base.__all__

0 comments on commit 0a3ae7f

Please sign in to comment.