gapic-generator-python icon indicating copy to clipboard operation
gapic-generator-python copied to clipboard

fix: add context manager return types

Open henribru opened this issue 2 years ago • 0 comments

Currently the __enter__ method of a service client has no annotated return type. While some type checkers infer return types, Mypy doesn't, so this means that in a statement like with FooClient(...) as client:, client ends up as Any if you use Mypy. This PR simply makes the very small change of explicitly annotating this return type (due to its size and simplicity it seemed overkill to create an issue first).

henribru avatar Oct 13 '22 18:10 henribru