Skip to content

Commit 069c966

Browse files
committed
export symbols using __all__ to avoid typing errors
Mentioned in #1322 Explanation on how it works - https://github.com/microsoft/pyright/blob/main/docs/typed-libraries.md#library-interface Example failing snippet: ```python import pygit2 # 4:23 - error: "Repository" is not exported from module "pygit2" (reportPrivateImportUsage) def test(repo: pygit2.Repository): ... ```
1 parent 894a4dc commit 069c966

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pygit2/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@
6161
from .utils import to_bytes, to_str
6262

6363

64+
__all__ = (
65+
"Repository",
66+
)
67+
6468
# Features
6569
features = enums.Feature(C.git_libgit2_features())
6670

0 commit comments

Comments
 (0)