Skip to content

Add mypy error code to type ignore. #547

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

Merged
merged 1 commit into from
Aug 3, 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: 1 addition & 1 deletion mypy_protobuf/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ def write_grpc_async_hacks(self) -> None:
# _ServicerContext is supertyped by grpc.ServicerContext and grpc.aio.ServicerContext
# So both can be used in the contravariant function parameter position.
wl(
"class _ServicerContext({}, {}): # type: ignore",
"class _ServicerContext({}, {}): # type: ignore[misc, type-arg]",
self._import("grpc", "ServicerContext"),
self._import("grpc.aio", "ServicerContext"),
)
Expand Down
2 changes: 1 addition & 1 deletion test/generated/testproto/grpc/dummy_pb2_grpc.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ _T = typing.TypeVar('_T')
class _MaybeAsyncIterator(collections.abc.AsyncIterator[_T], collections.abc.Iterator[_T], metaclass=abc.ABCMeta):
...

class _ServicerContext(grpc.ServicerContext, grpc.aio.ServicerContext): # type: ignore
class _ServicerContext(grpc.ServicerContext, grpc.aio.ServicerContext): # type: ignore[misc, type-arg]
...

class DummyServiceStub:
Expand Down
2 changes: 1 addition & 1 deletion test/generated/testproto/grpc/import_pb2_grpc.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ _T = typing.TypeVar('_T')
class _MaybeAsyncIterator(collections.abc.AsyncIterator[_T], collections.abc.Iterator[_T], metaclass=abc.ABCMeta):
...

class _ServicerContext(grpc.ServicerContext, grpc.aio.ServicerContext): # type: ignore
class _ServicerContext(grpc.ServicerContext, grpc.aio.ServicerContext): # type: ignore[misc, type-arg]
...

class SimpleServiceStub:
Expand Down