Skip to content

Commit 0a3ae7f

Browse files
authored
Update __all__ statements to a simpler form that is better supported 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
1 parent dad2691 commit 0a3ae7f

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

asyncpg/__init__.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,5 @@
1515
from ._version import __version__ # NOQA
1616

1717

18-
__all__ = (
19-
('connect', 'create_pool', 'Pool', 'Record', 'Connection')
20-
+ exceptions.__all__ # NOQA
21-
)
18+
__all__ = ('connect', 'create_pool', 'Pool', 'Record', 'Connection')
19+
__all__ += exceptions.__all__ # NOQA

asyncpg/exceptions/__init__.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -1040,7 +1040,7 @@ class IndexCorruptedError(InternalServerError):
10401040
sqlstate = 'XX002'
10411041

10421042

1043-
__all__ = _base.__all__ + (
1043+
__all__ = (
10441044
'ActiveSQLTransactionError', 'AdminShutdownError',
10451045
'AmbiguousAliasError', 'AmbiguousColumnError',
10461046
'AmbiguousFunctionError', 'AmbiguousParameterError',
@@ -1180,3 +1180,5 @@ class IndexCorruptedError(InternalServerError):
11801180
'WindowingError', 'WithCheckOptionViolationError',
11811181
'WrongObjectTypeError', 'ZeroLengthCharacterStringError'
11821182
)
1183+
1184+
__all__ += _base.__all__

0 commit comments

Comments
 (0)