gapic-generator-python
gapic-generator-python copied to clipboard
fix: add context manager return types
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).