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

Fixing typing for namespaced aio import #52

Merged
merged 1 commit into from
Dec 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions grpc-stubs/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import typing
from concurrent import futures
from types import ModuleType, TracebackType

from grpc import aio

__version__: str

# This class encodes an uninhabited type, requiring use of explicit casts or ignores
Expand Down
7 changes: 7 additions & 0 deletions typesafety/test_grpc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@
reveal_type(Channel()) # N: Revealed type is "grpc.aio.Channel"
reveal_type(Server()) # N: Revealed type is "grpc.aio.Server"

- case: grpc_aio_package
main: |
import grpc

reveal_type(grpc.aio.Channel()) # N: Revealed type is "grpc.aio.Channel"
reveal_type(grpc.aio.Server()) # N: Revealed type is "grpc.aio.Server"

- case: grpc_status
main: |
from grpc import Status
Expand Down